bramstroker / homeassistant-powercalc

Custom component to calculate estimated power consumption of lights and other appliances
MIT License
1.01k stars 262 forks source link

Sensor not using expected Operating state #1983

Closed AvocadoPanic closed 8 months ago

AvocadoPanic commented 10 months ago

I've several Stelpro STZW402+ thermostats. They have a Thermostat Operating State v1 [42-66-0-state] Operating state value that is [0] Idle [1] Heating.

I can see in the logs the state change as the thermostat cycles the triac.

2024-01-07T02:54:42.831Z` SERIAL « 0x01090004003e034203018f                                            (11 bytes)
2024-01-07T02:54:42.901Z SERIAL » [ACK]                                                                   (0x06)
2024-01-07T02:54:42.950Z CNTRLR   [Node 062] [~] [Thermostat Operating State] state: 0 => 1         [Endpoint 0]
2024-01-06 21:54:42.956 INFO Z-WAVE: [Node 062] Value updated: 66-0-state 0 => 1
2024-01-07T02:54:42.971Z DRIVER « [Node 062] [REQ] [ApplicationCommand]
                                  └─[ThermostatOperatingStateCCReport]
                                      state: Heating
2024-01-07T02:54:51.447Z SERIAL « 0x01090004003e034203008e                                            (11 bytes)
2024-01-07T02:54:51.531Z SERIAL » [ACK]                                                                   (0x06)
2024-01-07T02:54:51.599Z CNTRLR   [Node 062] [~] [Thermostat Operating State] state: 1 => 0         [Endpoint 0]
2024-01-06 21:54:51.603 INFO Z-WAVE: [Node 062] Value updated: 66-0-state 1 => 0
2024-01-07T02:54:51.641Z DRIVER « [Node 062] [REQ] [ApplicationCommand]
                                  └─[ThermostatOperatingStateCCReport]
                                      state: Idle
2024-01-07T02:54:58.561Z SERIAL « 0x01090004003e034203018f                                            (11 bytes)
2024-01-07T02:54:58.641Z SERIAL » [ACK]                                                                   (0x06)
2024-01-07T02:54:58.698Z CNTRLR   [Node 062] [~] [Thermostat Operating State] state: 0 => 1         [Endpoint 0]
2024-01-06 21:54:58.704 INFO Z-WAVE: [Node 062] Value updated: 66-0-state 0 => 1
2024-01-07T02:54:58.735Z DRIVER « [Node 062] [REQ] [ApplicationCommand]
                                  └─[ThermostatOperatingStateCCReport]
                                      state: Heating
2024-01-06 21:55:02.709 INFO APP: GET /health/zwave 301 21.953 ms - 191
2024-01-07T02:55:08.286Z SERIAL « 0x01090004003e034203008e                                            (11 bytes)
2024-01-07T02:55:08.349Z SERIAL » [ACK]                                                                   (0x06)
2024-01-07T02:55:08.448Z CNTRLR   [Node 062] [~] [Thermostat Operating State] state: 1 => 0         [Endpoint 0]
2024-01-06 21:55:08.454 INFO Z-WAVE: [Node 062] Value updated: 66-0-state 1 => 0
2024-01-07T02:55:08.509Z DRIVER « [Node 062] [REQ] [ApplicationCommand]
                                  └─[ThermostatOperatingStateCCReport]
                                      state: Idle
2024-01-07T02:55:08.920Z SERIAL « 0x010c00040038063105012a029e4a                                      (14 bytes)
2024-01-07T02:55:08.951Z SERIAL » [ACK]                                                                   (0x06)
2024-01-07T02:55:09.047Z CNTRLR   [Node 056] [Multilevel Sensor] Air temperature: metadata updated  [Endpoint 0]
2024-01-06 21:55:09.058 INFO Z-WAVE: [Node 056] Metadata updated: 49-0-Air temperature
2024-01-07T02:55:09.069Z CNTRLR   [Node 056] [~] [Multilevel Sensor] Air temperature: 66 => 67      [Endpoint 0]
2024-01-06 21:55:09.070 INFO Z-WAVE: [Node 056] Value updated: 49-0-Air temperature 66 => 67
2024-01-07T02:55:09.072Z DRIVER

With States Power as below the sensor only ever reports 1393 watts, regardless if the operating state is Idle or Heating.

"0": 1
"1": 1380
idle: 0
Idle: 10
heating: 1391
Heating: 1392
Energy heat: 420
Heat: 1394
heat: 1393
bramstroker commented 10 months ago

You are providing Zwave debug logs, which is not really helpful in this stage. You should first have a look into the state of the HA entity. That's what powercalc looks at.

You can find the current state and it's attributes at the HA developer tools in the left menu. Next select states tab and filter your entity from the list. Share the state and attributes when you set to idle and when it is heating.

Did you setup powercalc sensor using GUI or YAML?

AvocadoPanic commented 10 months ago

I used the GUI to setup the sensor.

The state of the entity is 'heat', it does not change.

The state attribute 'hvac_action' is the attribute that matches the state of the thermostat.

hvac_modes:
  - heat
min_temp: 44.6
max_temp: 95
preset_modes:
  - none
  - Energy heat
current_temperature: 65
temperature: 63
hvac_action: idle
preset_mode: none
friendly_name: "Family Room Thermostat "
supported_features: 17
hvac_modes:
  - heat
min_temp: 44.6
max_temp: 95
preset_modes:
  - none
  - Energy heat
current_temperature: 64
temperature: 73
hvac_action: heating
preset_mode: none
friendly_name: "Family Room Thermostat "
supported_features: 17
bramstroker commented 10 months ago

See the docs: https://homeassistant-powercalc.readthedocs.io/en/latest/strategies/fixed.html Last section. You'll need to specify hvac_action.

Like this.

hvac_action|heating: 1391
hvac_action|idle: 10

Let me know if it works.

github-actions[bot] commented 9 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 8 months ago

This issue was closed because it has been stalled for 5 days with no activity.