Giter VIP home page Giter VIP logo

plf10's Introduction

KAUF Power Monitoring Smart Plug (PLF10)

The recommended way to import a plug into your ESPHome dashboard is through the dashboard import feature. The plug should show up in the ESPHome dashboard as being available to adopt. Below is the minimum necessary yaml, which can be used to manually add your device instead. Change the name and friendly_name substitutions to fit your use case. Adding a use_address: under wifi: will allow you to point the ESPHome dashboard to the device on your network for flashing OTA.

The friendly_name substitution is recommended and will not be automatically created by the ESPHome dashboard import. If you use the ESPHome dashboard import feature, we recommend that you add a friendly_name substitution to rename all of the entities in Home Assistant in one line of yaml.

substitutions:
  name: bedroom-lamp
  friendly_name: Bedroom Lamp

packages:
  kauf.plf10: github://KaufHA/PLF10/kauf-plug.yaml

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

Repo Contents

This repo contains files for the PLF10 Power Monitoring Smart Plug.

kauf-plug.yaml - The yaml file recommended to import a plug into your ESPHome dashboard and keep all custom KAUF functionality. This is the yaml file incorporated automatically when the dashboard import feature is used.

kauf-plug-lite.yaml - A yaml file without any Kauf custom components but otherwise keeping as much functionality from kauf-plug.yaml as possible.

kauf-plug-minimal.yaml - A yaml file to import a plug into your ESPHome dashboard with only basic power monitoring smart plug functionality using stock ESPHome.

kauf-plug-update.yaml - The yaml file to build the update bin file. Generally not useful to end users.

kauf-plug-factory.yaml - The yaml file to build the factory bin file. Generally not useful to end users.

Control Entities

Kauf Plug switch entity - The main switch that controls the plug's relay. It will be named just Kauf Plug, or whatever you set the friendly_name substitution to in yaml. All other entities will be prefixed with the name of this entity plus whatever is indicated below for the particular other entity.

Blue LED switch entity - Controls the blue LED on and off.

Red LED switch entity - Controls the red LED on and off.

Configuration Entities

If using the precompiled binary or kauf-plug.yaml as a package in the ESPHome dashboard, the following configuration entities are automatically created. Entities listed as disabled by default can be enabled in Home Assistant, or simply modified through the web interface by clicking "Visit Device" in Home Assistant or typing the plug's IP address into a web browser. Adding the substitution disable_entities: "false" in your yaml file will cause all entities to be automatically enabled in Home Assistant.

Blue LED Brightness number entity - sets the brightness of the blue LED when on.

Blue LED Config select entity - Configures the behavior of the blue LED. Has the following options. Defaults to Power Status.

  • Power Status: LED follows relay state.
  • No Automation: The plug will never automatically change the LED, but the LED can still be user-controlled via the light entity.
  • Invert Power Status: LED follows the inverse of the relay's state (LED on when relay is off).
  • Error Status: The LED will blink when an error is detected. The most common errors are being unable to connect to Wi-Fi or Home Assistant.
  • Error and Power: The LED will follow the relay state, but then also blink when an error is detected.
  • Error and Invert Power: The LED will follow the inverse of the relay state, but then also blink when an error is detected.

Red LED Brightness number entity - sets the brightness of the red LED when on.

Red LED Config select entity - Same as the Blue LED select entity, but for the Red LED. Defaults to Error Status.

Button Config select entity - Defines when the button toggles the relay. To disable the button toggling the relay, select the Don't Toggle option. Otherwise, you can select the relay to toggle either on press or on release of the button. Toggle on release might be desired in order to have a different action performed when the button is held for a certain amount of time. For instance, the precompiled binary defaults to toggling on release so that the toggle can be blocked in case the button is held for 30 seconds to reenable the Wi-Fi AP.

Boot State select entity - Defines the relay's behavior on boot.

  • Restore Power Off State: The relay will restore its state from the last time the plug was changed before power off or reboot.
  • Invert Power Off State: The relay will toggle every time it is reboot or powered off and back on.
  • Always On: The relay will always turn on when the plug boots.
  • Always Off: The relay will always remain off when the plug boots.
  • YAML Configured: The boot state is set using the sub_restore_mode: substitution to any valid value for a GPIO switch's restore mode.

Monitoring Update Interval select entity - Disabled by default. Defines the update frequency for the power monitoring sensor entities. Defaults to 10s. Hard coded options are 2s, 5s, 10s, 30s, and 60s. The YAML Configured option uses the value defined by the sub_update_interval: substitution in YAML. For the precompiled binaries, this is set to 20s to provide an additional option. Changing this value will cause the plug to automatically reboot to effect the change.

Early Publish switch entity - controls whether the plug will report power usage before the configured update interval if a change greater than configured thresholds is detected. Defaults to on. Default thresholds are +/- 3w or 25%.

Debounce Time number entity - Disabled by default. Defines an amount of time that the button needs to be held before toggling the relay. Defaults to 100ms and has a minimum value of 50ms. The PLF10's button needs at least a minimum of 40ms debounce, but the actual necessary value depends on the amount of EMI in the environment where the plug is being used. Changing this value will cause the plug to automatically reboot to effect the change.

No Hass switch entity - Disabled by default. Turn this switch on if not using Home Assistant with the plug. Prevents the plug from flashing an error due to no API connection and rebooting every 15 minutes.

Scale Current number entity - Disabled by default. Scales the current sensor. Can be used to calibrate the plug.

Scale Power number entity - Disabled by default. Scales the power sensor. Can be used to calibrate the plug.

Scale Voltage number entity - Disabled by default. Scales the voltage sensor. Can be used to calibrate the plug.

Use Threshold number entity - Disabled by default. Sets a threshold for the Device in Use binary sensor. The binary sensor turns on if the power detected by the plug exceeds the threshold.

Diagnostic Entities

If using the precompiled binary or kauf-plug.yaml as a package in the ESPHome dashboard, the following diagnostic entities are automatically created. All diagnostic entities are disabled by default. Adding the substitution disable_entities: "false" in your yaml file will cause all entities to be automatically enabled in Home Assistant.

Restart Firmware button entity - Press this button to reboot the plug.

Button Press Duration sensor entity - Indicates the amount of time in milliseconds that the button was last pressed for. Reads zero while the button is being pressed.

IP Address sensor entity - Gives the plug's IP address.

Uptime number entity - Gives the plug's uptime in seconds.

Advanced Settings (set via YAML substitutions)

When using kauf-plug.yaml as a package in the ESPHome dashboard, you can configure the following aspects by adding substitutions. The substitutions section of kauf-plug.yaml has comments with more explanation as well. Adding one of these in your local yaml will overwrite the corresponding value in kauf-plug.yaml.

name - Defines the plug's name in the ESPHome dashboard, the device name in Home Assistant, mDNS URL, and other various aspects. The name should use only lower-case letters and dashes. Do not use spaces or underlines.

friendly_name - The friendly name will be used to name every entity in Home Assistant. Add a substitution to change this to something descriptive for each device. Capital letters and spaces are good for the friendly name.

sub_restore_mode - defines the state of the relay on boot-up. See more about the options under restore_mode here: GPIO Switch. The boot mode select entity must remain in the YAML Configured option for this substitution to be effective.

disable_entities - Adding a substitution to redefine this to "false" will result in all entities being automatically enabled in Home Assistant.

disable_webserver - Adding a substitution to redefine this to "true" will result in the plug's webserver not listening on port 80.

button actions - The sub_on_press and sub_on_release substitutions can be used to define scripts that will run based on button press and release if you want something different than the default actions to happen.

plug state actions - The sub_on_turn_on and sub_on_turn_off substitutions can be used to define scripts that will run when the plug's relay turns on and off, respectively.

sub_toggle_check - defines a script that, if running, will stop the button from toggling on release. Can be used to stop a button press action from occurring when a hold action executed instead.

default_button_config - defines the default option for the button config select entity.

sub_default_scale_* - defines default values for the power, current, and voltage scaling.

power monitoring calibration - all of the values used to calibrate the power monitoring calibration can be overwritten using substitutions to make the calibration more accurate (current_resistor_val, voltage_divider_val, sub_hlw_model, power_cal_*, current_cal_*, voltage_cal_*).

power monitoring update interval (sub_update_interval:) - Defines the time delay between updates of the power monitoring sensors. The power monitoring update interval select entity needs to be set to YAML Configured for this substitution to take effect.

sub_pm_initial_option - Defines the default option for the power monitoring update interval select entity.

sub_early_publish_percent - Defines a percentage change, relative to the current power output, at which time the plug will ignore the configured update interval and immediately report a new power output to the sensor. Defaults to 25%.

sub_early_publish_percent_min_power - Defines a minimum power, under which the early publish percent configuration will be ignored. The plug will never publish early based on percentage change if under this value. Defaults to 0.5W.

sub_early_publish_absolute - Defines an absolute power change after which the plug will ignore the configured update interval and update immediately. The unit for this is NOT WATTS but rather a raw value used under the hood for processing. To figure out what value you need here, you can enable verbose logging and the HLW component will output the needed raw value. For the PLF10 plug, 1W translates to 5.56. Defaults to 16.68, which is an approximately 3w change.

sub_hlw_timeout - sets an amount of time to wait for a signal from the power monitoring chip before assuming the power being used is 0w. Defaults to 3s.

Wi-Fi networks

Multiple Wi-Fi networks can now be configured with the networks: key under wifi:. By default, the configured networks: will be added in addition to the default initial_ap network. If you want to only include the networks: you added in your local yaml without initial_ap as well, then you need to set only_networks: true under wifi:. If you set your SSID/password without the networks: key, then that will automatically overwrite the default initial_ap network.

Note: With multiple networks configured, you will need to disable fast_connect, which is on by default, with fast_connect: false.

Additional Automations (set via YAML substitutions)

The following substitutions can be set to the name of a script to execute automatically in certain circumstances. You need to write the script in your yaml file.

sub_on_press - executes right when button is initially pressed

sub_on_release - executes right when button is released

sub_on_hold_30s - executes right when button has been held for 30s, while button is still being held

sub_on_turn_on - executes right when relay turns on

sub_on_turn_off - executes right when relay turns off

Factory Reset

Going to the plug's URL in a web browser and adding /reset will completely wipe all settings from flash memory. Note that this will wipe the plug's memory of whether the relay was on or off, and therefore the plug may turn off.

Clearing Wi-Fi Credentials, Getting Wi-Fi AP to Reconfigure Credentials

Holding the plug's button for 30 seconds will clear any programmed Wi-Fi credentials, including any hard coded via yaml configuration, and cause the plug to put its Wi-Fi AP back up. Going to the plug's URL in a web browser and adding /clear will do the same thing. No other settings or data will be lost.

Troubleshooting

Binary Size Error

ESPHome began adding API encryption by default, which may make the plug binary files too big to OTA update. kauf-plug.yaml v2.03 removed the light entities and replaced them with switch entities to toggle lights and number entities to control brightness. This change reduced the binary size and OTA should now work with API encryption without a problem.

If you are still getting the message ERROR Error binary size: Error: ESP does not have enough space to store OTA file., we recommend that you remove API encryption by commenting out or deleting the following lines:

# api:
#   encryption:
#     key: ...

If you want to keep API encryption, you can flash first with the kauf-plug-minimal.yaml file each time you need to update or upgrade, and then revert back to the kauf-plug.yaml.

Plugs turning themselves on and off

Our latest batch of smart plugs has a hardware issue making them susceptible to radio interference, which can make the ESP think that the button was pressed when it really wasn't. To filter out these spurious presses, a debounce of 100ms was added to the button in the latest firmware release. Please contact us if the plug is still turning itself on and off even after updating to the latest firmware version and we will warranty the plug.

Additional Troubleshooting

General troubleshooting ideas applicable to all products are located in the Common repo's readme.

Recommended Tasmota Template

{"NAME":"KAUF Plug","GPIO":[576,0,320,0,224,2720,0,0,2624,32,2656,0,0,0],"FLAG":0,"BASE":18, "CMND":"SwitchDebounce 100", "CMND":"ButtonDebounce 100"}

This page explains how to use the template if you need help: https://templates.blakadder.com/howto.html

Links

plf10's People

Contributors

alexfranke avatar kaufha avatar warthog9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

plf10's Issues

Error with installing config to plug

INFO Reading configuration /config/esphome/kauf-plug-ebda6e.yaml...
INFO Updating https://github.com/KaufHA/common@None
INFO Updating https://github.com/KaufHA/PLF10@None
ERROR Unable to import component switch:
Traceback (most recent call last):
  File "/esphome/esphome/loader.py", line 162, in _lookup_module
    module = importlib.import_module(f"esphome.components.{domain}")
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/config/esphome/.esphome/external_components/73d8076b/components/switch/__init__.py", line 6, in <module>
    from esphome.const import (
ImportError: cannot import name 'DEVICE_CLASS_OUTLET' from 'esphome.const' (/esphome/esphome/const.py)
INFO Detected timezone 'America/Chicago'
Failed config

My config file:

esphome:
  name: kauf-plug

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: "<random_string>"

wifi:
  ssid: xxxxxx
  password: xxxxxxx
  manual_ip:
    static_ip: 10.211.x.y
    gateway: 10.211.x.1
    subnet: 255.255.255.0
    
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Kauf-Plug"
    password: "xxxxxxxx"

captive_portal:

packages:
  kauf.plf10: github://KaufHA/PLF10/kauf-plug.yaml

substitutions:
  name: kauf-plug
  friendly_name: Kauf Plug

Problem with Kauf Plug and TasmoAdmin, plug crashing and rebooting

I have TasoAdmin v1.8.0 running in a docker container on a Ubuntu 20 x86_64 machine. When I leave the app open to the devices page, about once every 20 to 30 minutes the Kauf Plug I am testing crashes. If I close the TasoAdmin page, the problem stops. I'm not seeing this issue on any other of my tasmota devices, including a number of plug devices.

I'm not sure how to capture the before events better, but this is what I have if I leave the console open for the plug. Let me know how I can capture better data.

10.1.0(tasmota) on Plug.

00:00:00.001 HDW: ESP8266EX
00:00:00.050 CFG: Loaded from flash at FB, Count 369
00:00:00.056 QPC: Count 1
00:00:00.065 Project tasmota - Tasmota Version 10.1.0(tasmota)-2_7_4_9(2021-12-08T14:47:33)
00:00:00.555 WIF: Connecting to AP1 gfi Channel 3 BSSId 48:8F:5A:AA:BB:FF in mode 11n as tasmota-EBC7B8-1976...
00:00:01.753 WIF: Connected
00:00:02.007 HTP: Web server active on tasmota-EBC7B8-1976 with IP address 192.168.2.172
19:22:40.040 MQT: Attempting connection...
19:22:40.056 MQT: Connected
19:22:40.059 MQT: tele/tasmota_EBC7B8/LWT = Online (retained)
19:22:40.062 MQT: cmnd/tasmota_EBC7B8/POWER = 
19:22:40.075 MQT: tele/tasmota_EBC7B8/INFO1 = {"Info1":{"Module":"KAUF Plug","Version":"10.1.0(tasmota)","FallbackTopic":"cmnd/DVES_EBC7B8_fb/","GroupTopic":"cmnd/tasmotas/"}}
19:22:40.084 MQT: tele/tasmota_EBC7B8/INFO2 = {"Info2":{"WebServerMode":"Admin","Hostname":"tasmota-EBC7B8-1976","IPAddress":"192.168.2.172"}}
19:22:40.105 MQT: tele/tasmota_EBC7B8/INFO3 = {"Info3":{"RestartReason":{"Exception":3,"Reason":"Exception","EPC":["4027264e","00000000","00000000"],"EXCVADDR":"40272676","DEPC":"00000000","CallChain":["40105c7c","40105c79","400005e1","40255ea1","40266c47","40000f68","40000f58","401011da","40100a50","40100a71","402738a0","402738ad","402738f2","4024b418","40000f49","40000f49","40000f49","40000e19","40105a7d","40105a83","4010000d","4026c334","4026c2e5","401058c5","401054aa","40104df9","401053ad","40105685","4010394e","4000050c","40100a50"]}}}
19:22:40.147 MQT: stat/tasmota_EBC7B8/RESULT = {"POWER":"ON"}
19:22:40.152 MQT: stat/tasmota_EBC7B8/POWER = ON
19:22:43.485 QPC: Reset
19:22:45.111 MQT: stat/tasmota_EBC7B8/STATUS = {"Status":{"Module":0,"DeviceName":"Tasmota","FriendlyName":["Tasmota"],"Topic":"tasmota_EBC7B8","ButtonTopic":"0","Power":1,"PowerOnState":0,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0}}
19:22:45.142 MQT: stat/tasmota_EBC7B8/STATUS1 = {"StatusPRM":{"Baudrate":115200,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"http://ota.tasmota.com/tasmota/release/tasmota.bin.gz","RestartReason":"Exception","Uptime":"0T00:00:10","StartupUTC":"2022-03-08T18:22:35","Sleep":50,"CfgHolder":4617,"BootCount":224,"BCResetTime":"2021-05-03T05:06:29","SaveCount":369,"SaveAddress":"FB000"}}
19:22:45.175 MQT: stat/tasmota_EBC7B8/STATUS2 = {"StatusFWR":{"Version":"10.1.0(tasmota)","BuildDateTime":"2021-12-08T14:47:33","Boot":31,"Core":"2_7_4_9","SDK":"2.2.2-dev(38a443e)","CpuFrequency":80,"Hardware":"ESP8266EX","CR":"344/699"}}
19:22:45.196 MQT: stat/tasmota_EBC7B8/STATUS3 = {"StatusLOG":{"SerialLog":2,"WebLog":2,"MqttLog":0,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["gfi",""],"TelePeriod":10,"Resolution":"558180C0","SetOption":["00208009","2805C80001000600003C5A0A000000000000","00000080","00006000","00004000"]}}
19:22:45.230 MQT: stat/tasmota_EBC7B8/STATUS4 = {"StatusMEM":{"ProgramSize":616,"Free":384,"Heap":26,"ProgramFlashSize":1024,"FlashSize":1024,"FlashChipId":"14605E","FlashFrequency":40,"FlashMode":3,"Features":["00000809","8FDAC787","04368001","000000CF","010013C0","C000F981","00004004","00001000","00000020"],"Drivers":"1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,27,29,30,35,37,45","Sensors":"1,2,3,4,5,6"}}
19:22:45.264 MQT: stat/tasmota_EBC7B8/STATUS5 = {"StatusNET":{"Hostname":"tasmota-EBC7B8-1976","IPAddress":"192.168.2.172","Gateway":"192.168.2.2","Subnetmask":"255.255.255.0","DNSServer1":"192.168.2.242","DNSServer2":"1.1.1.1","Mac":"3C:61:05:EE:AA:CC","Webserver":2,"HTTP_API":1,"WifiConfig":2,"WifiPower":17.0}}
19:22:45.291 MQT: stat/tasmota_EBC7B8/STATUS6 = {"StatusMQT":{"MqttHost":"192.168.2.242","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_EBC7B8","MqttUser":"DVES_USER","MqttCount":1,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30,"SOCKET_TIMEOUT":4}}
19:22:45.315 MQT: stat/tasmota_EBC7B8/STATUS7 = {"StatusTIM":{"UTC":"2022-03-08T18:22:45","Local":"2022-03-08T19:22:45","StartDST":"2022-03-27T02:00:00","EndDST":"2022-10-30T03:00:00","Timezone":"+01:00","Sunrise":"07:17","Sunset":"18:43"}}
19:22:45.332 MQT: stat/tasmota_EBC7B8/STATUS9 = {"StatusPTH":{"PowerDelta":[0,0,0],"PowerLow":0,"PowerHigh":0,"VoltageLow":0,"VoltageHigh":0,"CurrentLow":0,"CurrentHigh":0}}
19:22:45.352 MQT: stat/tasmota_EBC7B8/STATUS10 = {"StatusSNS":{"Time":"2022-03-08T19:22:45","ENERGY":{"TotalStartTime":"2021-05-03T05:06:29","Total":189.245,"Yesterday":0.111,"Today":0.100,"Period": 0,"Power": 5,"ApparentPower":11,"ReactivePower": 9,"Factor":0.50,"Voltage":125,"Current":0.086}}}
19:22:45.375 MQT: stat/tasmota_EBC7B8/STATUS11 = {"StatusSTS":{"Time":"2022-03-08T19:22:45","Uptime":"0T00:00:10","UptimeSec":10,"Heap":24,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER":"ON","Wifi":{"AP":1,"SSId":"gfi","BSSId":"48:8F:5A:AA:BB:FF","Channel":3,"Mode":"11n","RSSI":88,"Signal":-56,"LinkCount":1,"Downtime":"0T00:00:03"}}}
19:22:45.414 MQT: stat/tasmota_EBC7B8/STATUS12 = {"StatusSTK":{"Exception":3,"Reason":"Exception","EPC":["4027264e","00000000","00000000"],"EXCVADDR":"40272676","DEPC":"00000000","CallChain":["40105c7c","40105c79","400005e1","40255ea1","40266c47","40000f68","40000f58","401011da","40100a50","40100a71","402738a0","402738ad","402738f2","4024b418","40000f49","40000f49","40000f49","40000e19","40105a7d","40105a83","4010000d","4026c334","4026c2e5","401058c5","401054aa","40104df9","401053ad","40105685","4010394e","4000050c","40100a50"]}}
19:22:53.572 MQT: stat/tasmota_EBC7B8/STATUS = {"Status":{"Module":0,"DeviceName":"Tasmota","FriendlyName":["Tasmota"],"Topic":"tasmota_EBC7B8","ButtonTopic":"0","Power":1,"PowerOnState":0,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0}}
19:22:53.604 MQT: stat/tasmota_EBC7B8/STATUS1 = {"StatusPRM":{"Baudrate":115200,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"http://ota.tasmota.com/tasmota/release/tasmota.bin.gz","RestartReason":"Exception","Uptime":"0T00:00:18","StartupUTC":"2022-03-08T18:22:35","Sleep":50,"CfgHolder":4617,"BootCount":225,"BCResetTime":"2021-05-03T05:06:29","SaveCount":370,"SaveAddress":"FA000"}}
19:22:53.638 MQT: stat/tasmota_EBC7B8/STATUS2 = {"StatusFWR":{"Version":"10.1.0(tasmota)","BuildDateTime":"2021-12-08T14:47:33","Boot":31,"Core":"2_7_4_9","SDK":"2.2.2-dev(38a443e)","CpuFrequency":80,"Hardware":"ESP8266EX","CR":"344/699"}}
19:22:53.658 MQT: stat/tasmota_EBC7B8/STATUS3 = {"StatusLOG":{"SerialLog":2,"WebLog":2,"MqttLog":0,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["gfi",""],"TelePeriod":10,"Resolution":"558180C0","SetOption":["00208009","2805C80001000600003C5A0A000000000000","00000080","00006000","00004000"]}}
19:22:53.690 MQT: stat/tasmota_EBC7B8/STATUS4 = {"StatusMEM":{"ProgramSize":616,"Free":384,"Heap":25,"ProgramFlashSize":1024,"FlashSize":1024,"FlashChipId":"14605E","FlashFrequency":40,"FlashMode":3,"Features":["00000809","8FDAC787","04368001","000000CF","010013C0","C000F981","00004004","00001000","00000020"],"Drivers":"1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,27,29,30,35,37,45","Sensors":"1,2,3,4,5,6"}}
19:22:53.724 MQT: stat/tasmota_EBC7B8/STATUS5 = {"StatusNET":{"Hostname":"tasmota-EBC7B8-1976","IPAddress":"192.168.2.172","Gateway":"192.168.2.2","Subnetmask":"255.255.255.0","DNSServer1":"192.168.2.242","DNSServer2":"1.1.1.1","Mac":"3C:61:05:EE:AA:CC","Webserver":2,"HTTP_API":1,"WifiConfig":2,"WifiPower":17.0}}
19:22:53.749 MQT: stat/tasmota_EBC7B8/STATUS6 = {"StatusMQT":{"MqttHost":"192.168.2.242","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_EBC7B8","MqttUser":"DVES_USER","MqttCount":1,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30,"SOCKET_TIMEOUT":4}}
19:22:53.773 MQT: stat/tasmota_EBC7B8/STATUS7 = {"StatusTIM":{"UTC":"2022-03-08T18:22:53","Local":"2022-03-08T19:22:53","StartDST":"2022-03-27T02:00:00","EndDST":"2022-10-30T03:00:00","Timezone":"+01:00","Sunrise":"07:17","Sunset":"18:43"}}
19:22:53.792 MQT: stat/tasmota_EBC7B8/STATUS9 = {"StatusPTH":{"PowerDelta":[0,0,0],"PowerLow":0,"PowerHigh":0,"VoltageLow":0,"VoltageHigh":0,"CurrentLow":0,"CurrentHigh":0}}
19:22:53.812 MQT: stat/tasmota_EBC7B8/STATUS10 = {"StatusSNS":{"Time":"2022-03-08T19:22:53","ENERGY":{"TotalStartTime":"2021-05-03T05:06:29","Total":189.245,"Yesterday":0.111,"Today":0.100,"Power": 5,"ApparentPower":11,"ReactivePower": 9,"Factor":0.49,"Voltage":125,"Current":0.086}}}
19:22:53.837 MQT: stat/tasmota_EBC7B8/STATUS11 = {"StatusSTS":{"Time":"2022-03-08T19:22:53","Uptime":"0T00:00:18","UptimeSec":18,"Heap":25,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER":"ON","Wifi":{"AP":1,"SSId":"gfi","BSSId":"48:8F:5A:AA:BB:FF","Channel":3,"Mode":"11n","RSSI":84,"Signal":-58,"LinkCount":1,"Downtime":"0T00:00:03"}}}
19:22:53.873 MQT: stat/tasmota_EBC7B8/STATUS12 = {"StatusSTK":{"Exception":3,"Reason":"Exception","EPC":["4027264e","00000000","00000000"],"EXCVADDR":"40272676","DEPC":"00000000","CallChain":["40105c7c","40105c79","400005e1","40255ea1","40266c47","40000f68","40000f58","401011da","40100a50","40100a71","402738a0","402738ad","402738f2","4024b418","40000f49","40000f49","40000f49","40000e19","40105a7d","40105a83","4010000d","4026c334","4026c2e5","401058c5","401054aa","40104df9","401053ad","40105685","4010394e","4000050c","40100a50"]}}
19:22:54.413 MQT: tele/tasmota_EBC7B8/STATE = {"Time":"2022-03-08T19:22:54","Uptime":"0T00:00:19","UptimeSec":19,"Heap":26,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":43,"MqttCount":1,"POWER":"ON","Wifi":{"AP":1,"SSId":"gfi","BSSId":"48:8F:5A:AA:BB:FF","Channel":3,"Mode":"11n","RSSI":84,"Signal":-58,"LinkCount":1,"Downtime":"0T00:00:03"}}
19:22:54.446 MQT: tele/tasmota_EBC7B8/SENSOR = {"Time":"2022-03-08T19:22:54","ENERGY":{"TotalStartTime":"2021-05-03T05:06:29","Total":189.245,"Yesterday":0.111,"Today":0.100,"Period": 0,"Power": 5,"ApparentPower":11,"ReactivePower": 9,"Factor":0.50,"Voltage":125,"Current":0.086}}
19:23:00.891 MQT: stat/tasmota_EBC7B8/STATUS = {"Status":{"Module":0,"DeviceName":"Tasmota","FriendlyName":["Tasmota"],"Topic":"tasmota_EBC7B8","ButtonTopic":"0","Power":1,"PowerOnState":0,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0}}
19:23:00.922 MQT: stat/tasmota_EBC7B8/STATUS1 = {"StatusPRM":{"Baudrate":115200,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"http://ota.tasmota.com/tasmota/release/tasmota.bin.gz","RestartReason":"Exception","Uptime":"0T00:00:25","StartupUTC":"2022-03-08T18:22:35","Sleep":50,"CfgHolder":4617,"BootCount":225,"BCResetTime":"2021-05-03T05:06:29","SaveCount":370,"SaveAddress":"FA000"}}
19:23:00.955 MQT: stat/tasmota_EBC7B8/STATUS2 = {"StatusFWR":{"Version":"10.1.0(tasmota)","BuildDateTime":"2021-12-08T14:47:33","Boot":31,"Core":"2_7_4_9","SDK":"2.2.2-dev(38a443e)","CpuFrequency":80,"Hardware":"ESP8266EX","CR":"344/699"}}
19:23:00.977 MQT: stat/tasmota_EBC7B8/STATUS3 = {"StatusLOG":{"SerialLog":2,"WebLog":2,"MqttLog":0,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["gfi",""],"TelePeriod":10,"Resolution":"558180C0","SetOption":["00208009","2805C80001000600003C5A0A000000000000","00000080","00006000","00004000"]}}
19:23:01.003 MQT: stat/tasmota_EBC7B8/STATUS4 = {"StatusMEM":{"ProgramSize":616,"Free":384,"Heap":25,"ProgramFlashSize":1024,"FlashSize":1024,"FlashChipId":"14605E","FlashFrequency":40,"FlashMode":3,"Features":["00000809","8FDAC787","04368001","000000CF","010013C0","C000F981","00004004","00001000","00000020"],"Drivers":"1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,27,29,30,35,37,45","Sensors":"1,2,3,4,5,6"}}
19:23:01.036 MQT: stat/tasmota_EBC7B8/STATUS5 = {"StatusNET":{"Hostname":"tasmota-EBC7B8-1976","IPAddress":"192.168.2.172","Gateway":"192.168.2.2","Subnetmask":"255.255.255.0","DNSServer1":"192.168.2.242","DNSServer2":"1.1.1.1","Mac":"3C:61:05:EE:AA:CC","Webserver":2,"HTTP_API":1,"WifiConfig":2,"WifiPower":17.0}}
19:23:01.062 MQT: stat/tasmota_EBC7B8/STATUS6 = {"StatusMQT":{"MqttHost":"192.168.2.242","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_EBC7B8","MqttUser":"DVES_USER","MqttCount":1,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30,"SOCKET_TIMEOUT":4}}
19:23:01.087 MQT: stat/tasmota_EBC7B8/STATUS7 = {"StatusTIM":{"UTC":"2022-03-08T18:23:01","Local":"2022-03-08T19:23:01","StartDST":"2022-03-27T02:00:00","EndDST":"2022-10-30T03:00:00","Timezone":"+01:00","Sunrise":"07:17","Sunset":"18:43"}}
19:23:01.105 MQT: stat/tasmota_EBC7B8/STATUS9 = {"StatusPTH":{"PowerDelta":[0,0,0],"PowerLow":0,"PowerHigh":0,"VoltageLow":0,"VoltageHigh":0,"CurrentLow":0,"CurrentHigh":0}}
19:23:01.125 MQT: stat/tasmota_EBC7B8/STATUS10 = {"StatusSNS":{"Time":"2022-03-08T19:23:01","ENERGY":{"TotalStartTime":"2021-05-03T05:06:29","Total":189.245,"Yesterday":0.111,"Today":0.100,"Power": 5,"ApparentPower":11,"ReactivePower": 9,"Factor":0.48,"Voltage":125,"Current":0.086}}}
19:23:01.148 MQT: stat/tasmota_EBC7B8/STATUS11 = {"StatusSTS":{"Time":"2022-03-08T19:23:01","Uptime":"0T00:00:26","UptimeSec":26,"Heap":25,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER":"ON","Wifi":{"AP":1,"SSId":"gfi","BSSId":"48:8F:5A:AA:BB:FF","Channel":3,"Mode":"11n","RSSI":90,"Signal":-55,"LinkCount":1,"Downtime":"0T00:00:03"}}}
19:23:01.185 MQT: stat/tasmota_EBC7B8/STATUS12 = {"StatusSTK":{"Exception":3,"Reason":"Exception","EPC":["4027264e","00000000","00000000"],"EXCVADDR":"40272676","DEPC":"00000000","CallChain":["40105c7c","40105c79","400005e1","40255ea1","40266c47","40000f68","40000f58","401011da","40100a50","40100a71","402738a0","402738ad","402738f2","4024b418","40000f49","40000f49","40000f49","40000e19","40105a7d","40105a83","4010000d","4026c334","4026c2e5","401058c5","401054aa","40104df9","401053ad","40105685","4010394e","4000050c","40100a50"]}}
19:23:04.427 MQT: tele/tasmota_EBC7B8/STATE = {"Time":"2022-03-08T19:23:04","Uptime":"0T00:00:29","UptimeSec":29,"Heap":26,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER":"ON","Wifi":{"AP":1,"SSId":"gfi","BSSId":"48:8F:5A:AA:BB:FF","Channel":3,"Mode":"11n","RSSI":92,"Signal":-54,"LinkCount":1,"Downtime":"0T00:00:03"}}
19:23:04.458 MQT: tele/tasmota_EBC7B8/SENSOR = {"Time":"2022-03-08T19:23:04","ENERGY":{"TotalStartTime":"2021-05-03T05:06:29","Total":189.245,"Yesterday":0.111,"Today":0.100,"Period": 0,"Power": 5,"ApparentPower":11,"ReactivePower": 9,"Factor":0.50,"Voltage":125,"Current":0.086}}

Plug becomes "unavailable" a few times a day

I bought a 4-pack of these plugs and adopted them all with ESPHome Dashboard running in Docker on my Raspberry Pi. Home Assistant is running in another Docker container on the same Pi.

After resolving some initial struggles getting used to ESPHome and configuring the an appropriate 2.4GHz network at one end of my house for one plug, they have been working very responsively with two exceptions. Two of the plugs will occasionally show up as "Unavailable" in Home Assistant, leading to them being unable to be controlled through Home Assistant (or via automations). Sometimes they will resolve themselves after a few minutes, sometimes they will be "unavailable" until I physically remove them from the outlet and plug them back in, rebooting them. When they are "unavailable" in Home Assistant, they are also not available at their own web server.

Is this an issue that others have experienced?

What steps can I take to debug this issue on my end or potentially resolve it?

Thanks,
Wilson

Changing firmware to Tasmota

Hi,
I bought the plugs on Amazon. First poweron, I connect to the built in webserver, upload tasmota.bin, click Update, and then I just get "connection timed out". I've tried also tasmota.bin.gz and tried from my laptop (Firefox) or Android phone. Neither seem to work.
Is there some other way to upload Tasmota firmware? (If it really comes to it, I have the serial cable, but was hoping to avoid that)

plug won't connect to wi-fi network after update

Hello,

I am having an issue after trying to update the firmware of the plug to the latest version of the repository. Now the plug is not connecting the the wi-fi network and is does not appear to respond to the button to turn it on/off. It also appears to not be responding to me holding the button for 30s for it to forget the wifi credentials as I can't see any AP from it (checked with WIFI analyzer on android phone). For reference I have used the plug for several months with no apparent issue, so the hardware should be mostly OK.

The updated kauf-plug.yaml is what is the current latest commit on the repo (commit 2973da17141afefd2ccaa19c21021d209de596b0) and I only changed the name and wifi connections as follows:

diff kauf-plug.yaml kauf-plug-f6e9b1___new.yaml 
12,14c12,14
<   name: kauf-plug              # **** CHANGE DEVICE NAME TO SOMETHING UNIQUE PER DEVICE.  RENAME YAML FILE TO SAME NAME.    ****
<                                # **** USE DASHES (-) INSTEAD OF SPACES OR UNDERSCORE (_).  USE ONLY LOWER CASE LETTERS.     ****
<   friendly_name: Kauf Plug     # **** CHANGE FRIENDLY NAME TO SOMETHING UNIQUE PER DEVICE                                   ****
---
>   name: kauf-plug-f6e9b1                # **** CHANGE DEVICE NAME TO SOMETHING UNIQUE PER DEVICE.  RENAME YAML FILE TO SAME NAME.    ****
>                                         # **** USE DASHES (-) INSTEAD OF SPACES OR UNDERSCORE (_).  USE ONLY LOWER CASE LETTERS.     ****
>   friendly_name: Kauf Plug (f6e9b1)     # **** CHANGE FRIENDLY NAME TO SOMETHING UNIQUE PER DEVICE                                   ****
160,161c160,161
<   ssid: initial_ap            # !secret wifi_ssid
<   password: asdfasdfasdfasdf  # !secret wifi_password
---
>   ssid:     !secret wifi_ssid
>   password: !secret wifi_password

I've built the updated firmware file using ESPHome v2023.6.3 (which I think is the latest, or at least a recent version) on a RPi4 (which I think should not matter) with no apparent issue.

After building the fw file and compressing it with tar.gz (down to 361378 bytes, so it should be OK for an OTA update) I performed the OTA update and the device page said it was successful. As I mentioned right now I have a plug that is not connecting to a wifi network, red LED is dimly on and is not responding the the button.

I'd like for some help to fix / un-brick the device so I could continue using it.

Let me know if I was unlucky or if I did something wrong, and I am looking forward for some help.

p.s.: I will attach the "backup" and the "new" versions of the yaml configurations for the device that I used for reference. Let me know if me uploading the actual FW binary would help as well.

The top plug is the one with the issue (it uses the kauf-plug-f6e9b1___new.yaml configuration), the bottom one is using a configuration very similar (except the unique names) to the old configuration that I've attached (the kauf-plug-f6e9b1___backup.yaml configuration)
configurations.zip

photo_2023-07-08_10-21-05

KAUF Plug Not Connecting or Responding

Hello:

I have about a dozen KAUF plugs and most are working fine. I have two that have been unplugged for a few weeks, and they were previously working fine connecting to my wifi, showing up in ESPHome, and usable within Home Assistant. However, I just plugged them in and they are not responding. They are not connecting to my wifi now. In the troubleshooting, it says to hold the button for 5 seconds so it will rebroadcast the AP, but this does not work. I also see that if it is connected to the network, you can go to the IP address and reset wifi, however, this also does not work because it's not connecting to my wifi. The light on the plug flashes a pale blue light for a fraction of a second, and it repeats every few seconds. Without it resetting and without connecting to my wifi, I'm unsure how to use these again.

Thanks,
Chad

ERROR ESP requests password, but no password given!

I have 3 of your plugs. 2 flash fine. I'm trying to send a simple config file to the 3rd one:

substitutions:
  name: solar-shed-batt-heaters
  friendly_name: Solar Shed Batt Heaters

packages:
  Kauf.PLF10: github://KaufHA/PLF10/kauf-plug.yaml

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Solar-Shed-Batt-Heaters"
    password: !secret wifi_password

======================= [SUCCESS] Took 97.42 seconds =========================
INFO Successfully compiled program.
INFO Resolving IP address of solar-shed-batt-heaters.local
INFO -> 192.168.1.223
INFO Uploading /data/solar-shed-batt-heaters/.pioenvs/solar-shed-batt-heaters/firmware.bin (551232 bytes)
INFO Compressed to 375036 bytes
ERROR ESP requests password, but no password given!

l've tried resetting the esp but the issue remains.

Otherwise I'm super impressed! The full yaml file is a really good study of what can be done in ESPHome. I thought my 500 line config file that controls my wood pellet stove was impressive.. this has me beat by a mile!

Let user .yaml specify timezone

There's something wrong with my Home Assistant installation, and it refuses to admit that I'm not in timezone "Etc/UTC." So I've had to go through individual esphome device configurations and add my correct timezone to the time: stanza in the configuration. The problem is that kauf-plug.yaml doesn't appear to make it easy to override time:, or better yet provide a timezone in substitutions that it incorporates into its own time: statements.

I know I can always grab the whole kauf-plug.yaml file and build that myself, but it's really nice to have a relatively short customized .yaml for my own devices that integrates with the unmodified Kauf code.

Please allow users to easily specify a timezone.

Is there a way to guarantee that relay stays closed?

I'm using a Kauf Plug as a power meter for my desk, which includes my computer. Twice in the past few months my power has suddenly glitched, computer restarts, chaos ensues, etc. Today I figured out that the Kauf plug was responsible. I think it lost its connection to the internet, and like any ESPHome device rebooted in the hopes of restoring the connection.

That's normally a great feature, but in this case it makes the plug a lot less useful for my intended purpose.

I see reboot_timeout in https://esphome.io/components/wifi, and I'm about to try it like so:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  reboot_timeout: 0s

Does this sound right? Is there anything else I can do to configure the plug to never, ever, ever turn off the outlet?

Option to disable web server?

Thanks for making this plug and open sourcing the ESPHome configs!

I like everything about the default config except for the web server being enabled by default. I do not want other devices on my network to have access to configuration settings via insecure http URL.

web_server:

Could we add an option to disable the web server completely? I am happy to submit a PR if needed

[forced_hash] is an invalid option for [switch.gpio]. Please check the indentation.

In wanting to refine the calibration of the PLF10 plug device, I pulled the kauf-plug.yaml file , then adapted the volts, current, and watt calibration measurements. When attempting to install, I get the failure [forced_hash] is an invalid option for [switch.gpio]. Please check the indentation.

Pulled a fresh copy the kauf-plug.yaml file this time changing ONLY the name and friendly_name values. Saved, attempted to install, Again, I get the failure [forced_hash] is an invalid option for [switch.gpio]. Please check the indentation.

Reverted to the 'simple' installation configuration in the PLF10 README and was able to install, and the device appears in Home Assistant/ESPHome/webview.

The file name in all cases above was the same as the changed name: plug-2 item, and not the default kauf-plug

This issue has appeared ever since the forced hashes appeared, regardless of ESPHome version. Current ESPHome version here is 2.2.5

I would like to be able to refine the calibration from the stock settings, but using the full configuration does not seem to compile (install).

What's the obvious thing I am missing here?


Environment:

On Raspberry Pi 3 Model B+ (aarch64)

Home Assistant/ESPHome details:

version core-2022.2.9
installation_type Home Assistant Supervised
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.7
os_name Linux
os_version 5.10.92-v8+
arch aarch64
timezone America/Denver
Home Assistant Supervisor
host_os Debian GNU/Linux 11 (bullseye)
update_channel stable
supervisor_version supervisor-2022.01.1
docker_version 20.10.12
disk_total 58.4 GB
disk_used 16.4 GB
healthy true
supported true
supervisor_api ok
version_api ok
installed_addons ESPHome (2022.2.5), File editor (5.3.3), Samba Backup (5.0.0)

Flashed PLF10 with wrong firmware. How do I recover?

Due to an error while modifying the YAML of another device (D1 Mini Pro), I ended up flashing my PLF10 with the wrong firmware. When I got that straightened out, I got an error with a missing OTA password, but I was able to copy the password from the other device.
Now, when I try to install via ESPHOME, I get the following error:

ERROR Error binary size: Error: ESP has been flashed with wrong flash size. Please choose the correct 'board' option (esp01_1m always works) and then flash over USB.

I can still access the device via HTTP, so I tried that and got:

Update Failed: ERROR[8]: Flash config wrong real: 1048576 IDE: 16777216

Is there any way to recover from this?

ESP does not have enough space to store OTA file

After updating to ESPHome v2023.6.4 and trying OTA flash of my normal firmware, I recieve the following error message.

INFO Successfully compiled program.
INFO Resolving IP address of recirculation-pump-plug.local
INFO  -> REDACTED IP ADDRESS
INFO Uploading /data/recirculation-pump-plug/.pioenvs/recirculation-pump-plug/firmware.bin (608288 bytes)
INFO Compressed to 418843 bytes
ERROR Error binary size: Error: ESP does not have enough space to store OTA file. Please try flashing a minimal firmware (remove everything except ota)

Quick questions:

  1. How should I go about flashing the plug now? Is there any feature that I can disable to make the firmware smaller?
  2. Do the newer PLF12 plugs have a similar issue?

For reference, my ESPHome config file:

substitutions:
  name: "recirculation-pump-plug"
  friendly_name: Recirculation Pump Plug
  node_ip: REDACTED
  disable_webserver: "true"
  sub_restore_mode: ALWAYS_OFF

packages:
  Kauf.PLF10: github://KaufHA/PLF10/kauf-plug.yaml

esphome:
  name: ${name}
  name_add_mac_suffix: false

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  use_address: ${name}.local

  manual_ip:
    static_ip: ${node_ip}
    gateway: 192.168.0.1
    subnet: 255.255.255.0
    dns1: 192.168.0.100
    dns2: 8.8.8.8
  
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "${name}-HS"
    password: !secret ap_password

api:
  encryption:
    key: "REDACTED"

PLF10 Home Assistant Update FAIL

Home Assistant showing 2023.10.0 update for all 4 of my Kauf Plugs. Normal update via UI fails. Restarted firmware on all devices, restarted Home Assistant multiple times. All updates fail at exact same point (see log detail below):

Compiling .pioenvs/kplug-office-1/src/esphome/components/kauf_hlw8012/kauf_hlw8012.cpp.o
src/esphome/components/captive_portal/captive_portal.cpp: In member function 'void esphome::captive_portal::CaptivePortal::start()':
src/esphome/components/captive_portal/captive_portal.cpp:76:37: error: invalid cast from type 'esphome::network::IPAddress' to type 'uint32_t' {aka 'unsigned int'}
76 | this->dns_server_->start(53, "*", (uint32_t) ip);
| ^~~~~~~~~~~~~
*** [.pioenvs/kplug-office-1/src/esphome/components/captive_portal/captive_portal.cpp.o] Error 1
========================= [FAILED] Took 10.53 seconds =========================

I also attempted to enable (add captive_portal) to yaml file and restart firmware, restart Home Assistant and manually update 1 plug. No change - same error.

All 4 plugs have updated without issue for a year or more. Looking at GitHub looks package file (referenced in yaml config) was changed an hour ago. Unable to pinpoint change that may contribute so the updated file is just a variable to rule out and may have nothing to do with the issue.

Unable to compile kauf-plug-lite.yaml

I was testing out the different versions of the yaml files that you have provided and I am unable to compile with kauf-plug-lite.yaml. My system is using ESPHome v2022.12.1 that was released today.

I get the following error:

Compiling .pioenvs/kauf-plug-0ad993/src/main.cpp.o
/config/.esphome/packages/a0579e33/kauf-plug-lite.yaml: In lambda function:
/config/.esphome/packages/a0579e33/kauf-plug-lite.yaml:722:39: error: 'GPIO_SWITCH_RESTORE_DEFAULT_OFF' is not a member of 'esphome::gpio'
  722 |             relay->set_restore_mode(gpio::GPIO_SWITCH_RESTORE_DEFAULT_OFF);
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/config/.esphome/packages/a0579e33/kauf-plug-lite.yaml:724:39: error: 'GPIO_SWITCH_RESTORE_INVERTED_DEFAULT_OFF' is not a member of 'esphome::gpio'
  724 |             relay->set_restore_mode(gpio::GPIO_SWITCH_RESTORE_INVERTED_DEFAULT_OFF);
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/config/.esphome/packages/a0579e33/kauf-plug-lite.yaml:726:39: error: 'GPIO_SWITCH_ALWAYS_ON' is not a member of 'esphome::gpio'
  726 |             relay->set_restore_mode(gpio::GPIO_SWITCH_ALWAYS_ON);
      |                                       ^~~~~~~~~~~~~~~~~~~~~
/config/.esphome/packages/a0579e33/kauf-plug-lite.yaml:728:39: error: 'GPIO_SWITCH_ALWAYS_OFF' is not a member of 'esphome::gpio'
  728 |             relay->set_restore_mode(gpio::GPIO_SWITCH_ALWAYS_OFF);
      |                                       ^~~~~~~~~~~~~~~~~~~~~~
/config/.esphome/packages/a0579e33/kauf-plug-lite.yaml:730:39: error: 'GPIO_SWITCH_RESTORE_DEFAULT_ON' is not a member of 'esphome::gpio'
  730 |             relay->set_restore_mode(gpio::GPIO_SWITCH_$sub_restore_mode);
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*** [.pioenvs/kauf-plug-0ad993/src/main.cpp.o] Error 1

This seems to have changed in: esphome/esphome@c55e01f if I am reading the code correctly.

I can use kauf-plug.yaml, so there is no rush getting this fixed. Thanks!

ESPHome updates failing with older plugs; gzip and OTA update OK

Current: Home Assistant 2022.12.7 Supervisor 2022.11.2 Frontend 20221213.1 - latest
ESPHome versions 12.1, 12.2. 12.3 (and earlier versions of HA to match ESPHome)
Firmware version 2.02(y) made using ESPHome version 2022.12.3 (last test)

Updates used to 'just work'. It seems that with the ESPHome 12.x versions, wireless update of two older PLF10 plugs bought Sep 2021 and Nov 2021 hangs and fails. Example:

========================= [SUCCESS] Took 44.50 seconds =========================
INFO Successfully compiled program.
INFO Connecting to w.x.y.z
INFO Uploading /data/nitelite-plug/.pioenvs/nitelite-plug/firmware.bin (551632 bytes)
INFO Compressed to 375434 bytes
Uploading: [===============================================             ] 79% 
ERROR Error sending data: timed out

When I save the firmware.bin file locally, gzip it, and visit the device webpage, upload the firmware.bin.gz file, the update is successful. File sizes of uncompressed and compressed files report the same using either method. It seems the timeout might be because the older PLF10s can't fit the new version, even if compressed, using the ESPHome interface (wild guess).

I cleaned the installation directory; same result.

This does add an extra layer of 'work' having to compile, compress, and OTA upload the compressed firmware manually for those two plugs, instead of just update all when a new version of ESPHome comes up. Not a big deal, functionally there is no issue.

Wireless update of recent (Jun 2022) PLF10 updates just fine from ESPHome HA page.

Any thoughts on why the ESPHome update method might be giving me grief? Does the age of the PLF10s have anything to do with this?

Add multi-click and long-press support to smart plugs

[Enhancement] Would it be possible to get multi-click and long-press support on the smart plugs... similar to the SRF10 RGB wall switch?

Double and triple press would be great, and 4- and 5-press would be awesome. Long press would be nice, and maybe even an additional "longer" press.

FYI, I use some of my plugs as makeshift switches for controlling various lights. I disconnect the relay on some, so having the option to do this via a slider exposed in HA would be nice too.

thanks!

How to verify plug has factory software?

Curious, how do I verify the PLF10 plug I bought off amazon has factory software? How can I ensure nobody else flashed other software on it and returned it to Amazon?

Asking because one of the plugs I received is not functioning as intended. I noticed it creates the WiFi hotspot with SSID kuaf_plug_xxx 2.0.0. But the install instructions mention the hotspot name should be Kauf Plug Hotspot. Curious if this is intended or if the plug has been tampered with.

1.8 firmware issue

Hi! I just purchased a plug and set it up in home assistant and all was working. I then updated the firmware to version 1.8 and now the light on the plug is red, button does nothing, and is disconnected from wifi. I've tried holding down the button to reset, but no luck. Appreciate any guidance.

Red Led Control not working correctly

Upgraded from ESP Home 2023.5.5 to ESP Home 2023.6.1 and noticed that the Red LED control is not working as expected.
have tried each version to 2023.6.4 each is showing the same issue, the Red LED behaves like it's set to Invert power status, if it is set to power status and invert power status.

config yaml:
substitutions:
name: kauf-plug-7aaa10
packages:
Kauf.PLF12: github://KaufHA/PLF12/kauf-plf12.yaml
esphome:
name: ${name}
name_add_mac_suffix: false
comment: OilHeaterControl
api:

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password

log showing led behavior:

00:02:17 [D] [switch:016] 'Kauf Plug' Turning OFF. # red led set to invert power
00:02:17 [D] [switch:066] 'Kauf Plug': Sending state OFF
00:02:18 [D] [switch:066] 'Kauf Plug Red LED': Sending state ON
00:02:20 [D] [switch:012] 'Kauf Plug' Turning ON.
00:02:20 [D] [switch:066] 'Kauf Plug': Sending state ON
00:02:20 [D] [switch:066] 'Kauf Plug Red LED': Sending state OFF
00:02:20 [D] [script:077] Script 'script_save_changes' restarting (mode: restart) # working as expected
00:02:23 [D] [esp8266.preferences:274] Saving preferences to flash...
00:02:24 [D] [select:062] 'Kauf Plug Red LED Config' - Setting
00:02:24 [D] [select:115] 'Kauf Plug Red LED Config' - Set selected option to: Power Status
00:02:24 [D] [select:015] 'Kauf Plug Red LED Config': Sending state Power Status (index 0) # changed red led config to power status
00:02:25 [D] [script:077] Script 'script_save_changes' restarting (mode: restart)
00:02:28 [D] [esp8266.preferences:274] Saving preferences to flash...
00:02:28 [D] [switch:016] 'Kauf Plug' Turning OFF.
00:02:28 [D] [switch:066] 'Kauf Plug': Sending state OFF
00:02:28 [D] [switch:066] 'Kauf Plug Red LED': Sending state ON # red LED still behaving as if set to invert power config
00:02:30 [D] [switch:012] 'Kauf Plug' Turning ON.
00:02:30 [D] [switch:066] 'Kauf Plug': Sending state ON
00:02:30 [D] [switch:066] 'Kauf Plug Red LED': Sending state OFF
00:02:30 [D] [script:077] Script 'script_save_changes' restarting (mode: restart)
00:02:33 [D] [esp8266.preferences:274] Saving preferences to flash...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.