Hi,
I’m currently testing that branch, here’s a config for the shelly 2.5. Be aware that the webserver is enabled and I haven’t yet set the proper reporting intervals and I have to filter out readings lower than 1 W because they look like noise even if there’s nothing connected.
This is a little off topic, but are you sure about your settings for the temperature-sensor? I get crazy high temperatures with this adc-resistance and b-constant.
@anarro Just started working with my Shelly 2.5 and found this thead. Saved me a lot of work figuring things out. I loaded your code and it seems to be working. Here is a sample of the log output…
[12:20:44][D][adc:056]: ‘temp_analog_reading’: Got voltage=0.43V
[12:20:44][D][sensor:092]: ‘temp_analog_reading’: Sending state 0.43457 V with 2 decimals of accuracy
[12:20:44][D][resistance:037]: ‘temp_resistance_reading’ - Resistance 4853.1Ω
[12:20:44][D][sensor:092]: ‘temp_resistance_reading’: Sending state 4853.11182 Ω with 1 decimals of accuracy
[12:20:44][D][ntc:026]: ‘Smart Plug Temperature’ - Temperature: 45.5°C
[12:20:44][D][sensor:092]: ‘Smart Plug Temperature’: Sending state 45.50340 °C with 1 decimals of accuracy
[12:20:49][D][api.connection:583]: Client ‘Home Assistant 0.102.3 (192.168.1.200)’ connected successfully!
[12:20:54][D][adc:056]: ‘temp_analog_reading’: Got voltage=0.44V
[12:20:54][D][sensor:092]: ‘temp_analog_reading’: Sending state 0.43555 V with 2 decimals of accuracy
[12:20:54][D][resistance:037]: ‘temp_resistance_reading’ - Resistance 4865.7Ω
[12:20:54][D][sensor:092]: ‘temp_resistance_reading’: Sending state 4865.67578 Ω with 1 decimals of accuracy
[12:20:54][D][ntc:026]: ‘Smart Plug Temperature’ - Temperature: 45.4°C
[12:20:54][D][sensor:092]: ‘Smart Plug Temperature’: Sending state 45.42505 °C with 1 decimals of accuracy
[12:21:00][D][sensor:092]: ‘Smart Plug Active Power B’: Sending state -0.01299 W with 1 decimals of accuracy
[12:21:00][D][sensor:092]: ‘Smart Plug Active Power A’: Sending state 0.07792 W with 1 decimals of accuracy
[12:21:00][D][sensor:092]: ‘Smart Plug Current B’: Sending state 0.01773 A with 2 decimals of accuracy
[12:21:00][D][sensor:092]: ‘Smart Plug Current A’: Sending state 0.01773 A with 2 decimals of accuracy
[12:21:00][D][sensor:092]: ‘Smart Plug Voltage’: Sending state 123.33615 V with 1 decimals of accuracy
[12:21:04][D][adc:056]: ‘temp_analog_reading’: Got voltage=0.44V
[12:21:04][D][sensor:092]: ‘temp_analog_reading’: Sending state 0.43652 V with 2 decimals of accuracy
[12:21:04][D][resistance:037]: ‘temp_resistance_reading’ - Resistance 4878.2Ω
[12:21:04][D][sensor:092]: ‘temp_resistance_reading’: Sending state 4878.24854 Ω with 1 decimals of accuracy
[12:21:04][D][ntc:026]: ‘Smart Plug Temperature’ - Temperature: 45.3°C
[12:21:04][D][sensor:092]: ‘Smart Plug Temperature’: Sending state 45.34689 °C with 1 decimals of accuracy
Didn’t see a reply to this until today. I had to fudge the values around to get them to match another sensor for voltage. I also played around with the values for power and current to get them to match the values of the device (LED bulb) specs.
Just stumbled upon this thread… is anyone got any updates or improvements on the esphome code. I’m wanting to flash some shelly 2.5 and shelly 1.0 relays.
Does anyone have the code for shelly 1.0 to save me sometime?
I had partly the same problem. Only that the value was negative, I did not have the value multiplied by 10.
To solve my problem I had to comment out the filter on active_power_a (which is for Active Power B in Home Assistant)
sensor:
- platform: ade7953
voltage:
name: ${devicename} Voltage
current_a:
name: ${devicename} Current B
current_b:
name: ${devicename} Current A
active_power_a:
name: ${devicename} Active Power B
# filters:
# - multiply: -1
active_power_b:
name: ${devicename} Active Power A
filters:
- multiply: -1
update_interval: 60s
I suggest you try with this code and see if that solves your issue. Do a test with different known loads to confirm.
sensor:
- platform: ade7953
voltage:
name: ${devicename} Voltage
current_a:
name: ${devicename} Current B
current_b:
name: ${devicename} Current A
active_power_a:
name: ${devicename} Active Power B
# Multiply by positive 0.1 to try to correct wrong values
filters:
- multiply: 0.1
active_power_b:
name: ${devicename} Active Power A
filters:
- multiply: -1
update_interval: 60s