Both exist:
hourly_kwh is number of kwh consumed in one hour
hourly_kwh_count is summation for the first one, updated every hour
@jdawson must validate the proper name of his thermostat and sensor in developer tool and if possible post a screen capture so we can validate. Normally HA replace allcapital letter with lowercase letter. Alle attributes names must also be lowercase.
IC. thank you for clarifying.
There is another way to create a sensor as well. I use the UI helper which is quite easy to do now compare to a year ago.
Ok found it with your printscreen
Youāre with a miwi device in the neviweb custom_component. For those device there is only two energy attributes:
hourly_kwh
daily_kwh
So you need to change your sensor for:
template:
- sensor:
- name: "den_energy_sensor"
unique_id: sensor.den_energy_sensor
unit_of_measurement: "kWh"
device_class: energy
state_class: total
state: "{{ state_attr('climate.neviweb_climate_den','hourly_kwh') }}"
This should work
Your device name is climate.neviweb_climate_den
Itās not climate.neviweb130_climate_den
You must always validate in developer tool/states for the correct name of your device et the name of your device attribute that you can use.
It is not necessary to repeat -sensor : for everyone, just once is enough.
template:
- sensor:
- name: "Ćnergie quotidienne chauffage salle familiale"
unique_id: "energie_quotidienne_chauffage_salle_familiale"
state: "{{ state_attr('climate.neviweb130_climate_salle_familiale', 'daily_kwh') }}"
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
- name: "Ćnergie quotidienne chauffage atelier"
unique_id: "energie_quotidienne_chauffage_atelier"
state: "{{ state_attr('climate.neviweb130_climate_atelier', 'daily_kwh') }}"
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
- name: "Ćnergie quotidienne chauffage chambre invites"
unique_id: "energie_quotidienne_chauffage_chambre_invites"
state: "{{ state_attr('climate.neviweb130_climate_ch_invites', 'daily_kwh') }}"
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
Ok I did that thanksā¦
The variable we are using hourly_kwh goes back to 0 every hour.
I noticed your using total increasing in class should I use that? Or should I also use the daily_kwh variable using total increasing?
Right now i see NO dataā¦ but part of the problem is I know I have no heat on because it is summerā¦ But even when i turn on something for a few min so it shows in the graph in the neviweb app i have never seen it show in the HA data yet.
Ok everything is working now with this configuration for meā¦
Thanks to @ValMarDav and @claudegel for all your assistance.
template:
- sensor:
- name: "bathroom_energy_sen"
unique_id: sensor.bathroom_energy_sen
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
state: "{{ state_attr('climate.neviweb_climate_bathroom','hourly_kwh') }}"
- sensor:
- name: "bedroom_energy_sen"
unique_id: sensor.bedroom_energy_sen
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
state: "{{ state_attr('climate.neviweb_climate_bedroom','hourly_kwh') }}"
- sensor:
- name: "den_energy_sen"
unique_id: sensor.den_energy_sen
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
state: "{{ state_attr('climate.neviweb_climate_den','hourly_kwh') }}"
- sensor:
- name: "dining_room_energy_sen"
unique_id: sensor.dining_room_energy_sen
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
state: "{{ state_attr('climate.neviweb_climate_dining_room','hourly_kwh') }}"
- sensor:
- name: "ensuite_energy_sen"
unique_id: sensor.ensuite_energy_sen
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
state: "{{ state_attr('climate.neviweb_climate_ensuite','hourly_kwh') }}"
- sensor:
- name: "hall_energy_sen"
unique_id: sensor.hall_energy_sen
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
state: "{{ state_attr('climate.neviweb_climate_hall','hourly_kwh') }}"
- sensor:
- name: "joe_office_energy_sen"
unique_id: sensor.joe_office_energy_sen
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
state: "{{ state_attr('climate.neviweb_climate_joe_office','hourly_kwh') }}"
- sensor:
- name: "karen_office_energy_sen"
unique_id: sensor.karen_office_energy_sen
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
state: "{{ state_attr('climate.neviweb_climate_karen_office','hourly_kwh') }}"
- sensor:
- name: "living_room_energy_sen"
unique_id: sensor.living_room_energy_sen
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
state: "{{ state_attr('climate.neviweb_climate_living_room','hourly_kwh') }}"
- sensor:
- name: "porch_energy_sen"
unique_id: sensor.porch_energy_sen
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
state: "{{ state_attr('climate.neviweb_climate_porch','hourly_kwh') }}"
Anyone have an idea why my automation donāt work anymore ?
I think it stopped working this winter after an HA update but I didnāt get to look into it until now. I was too busy with family
But I really donāt understand the issue, what have changed in ha ?
alias: Send Outdoor Temperature
description: ""
trigger:
- platform: state
entity_id: sensor.otterburn_park_temperature
action:
- repeat:
count: "{{thermostats|length}}"
sequence:
- service: zha.set_zigbee_cluster_attribute
data:
ieee: "{{ thermostats[repeat.index-1] }}"
endpoint_id: 1
cluster_id: 65281
cluster_type: in
attribute: 16
value: "{{ ( trigger.to_state.state|float * 100 ) |int }}"
variables:
thermostats:
- 50:0b:91:40:00:02:8b:f1
- 50:0b:91:40:00:02:92:71
- 50:0b:91:40:00:02:cc:2b
- 50:0b:91:40:00:02:9d:98
- 50:0b:91:40:00:02:c7:dc
- 50:0b:91:40:00:02:cf:13
- 50:0b:91:40:00:02:aa:cf
- 50:0b:91:40:00:02:79:44
- 50:0b:91:40:00:02:a0:b1
- 50:0b:91:40:00:02:c1:06
- 50:0b:91:40:00:02:9e:e0
mode: single
- Make sure your sensor.otterburn_park_temperature is still giving you the outside temperature.
- Also maybe moving the variables section above the action section in your automation.
- add an id to your automation
id: send_outdoor_temperature
alias: Send Outdoor Temperature
description: ""
trigger:
Try this and let me know
I am at the same point.
I thought about using the sensor directly instead of the trigger.
So my automation is like this
alias: Send Outdoor Temperature
description: ""
trigger:
- platform: state
entity_id: sensor.otterburn_park_temperature
variables:
thermostats:
- 50:0b:91:40:00:02:8b:f1
- 50:0b:91:40:00:02:92:71
- 50:0b:91:40:00:02:cc:2b
- 50:0b:91:40:00:02:9d:98
- 50:0b:91:40:00:02:c7:dc
- 50:0b:91:40:00:02:cf:13
- 50:0b:91:40:00:02:aa:cf
- 50:0b:91:40:00:02:79:44
- 50:0b:91:40:00:02:a0:b1
- 50:0b:91:40:00:02:c1:06
- 50:0b:91:40:00:02:9e:e0
action:
- repeat:
count: "{{thermostats|length}}"
sequence:
- service: zha.set_zigbee_cluster_attribute
data:
ieee: "{{ thermostats[repeat.index-1] }}"
endpoint_id: 1
cluster_id: 65281
cluster_type: in
attribute: 16
value: "{{ ( ( states('sensor.otterburn_park_temperature')|float * 100 ) |int }}"
mode: single
But when I try to save I get :
Message malformed: template value should be a string for dictionary value @ data[āactionā][0][ārepeatā][āsequenceā][0][ādataā]
Any idea what it could mean ?
Did you check value from your sensor.otterburn_park_temperature
If there are no value then you get that error.
In HA there was many changes in weather provider. Especially Met.no which switch to new version of there api. In that case you need to get new key from Met in order to get there data
Hi @claudegel, first I want to say thanks for publishing a lot of great information around Sinope and zigbee/mqtt.
Iām using Z2M instead of ZHA and I am trying to enable flowMeterConfig
on my VA4220ZB
with a FS4220
attached. I found your documentation for passing in the Array data but I canāt seem to get it to stick.
What Iām trying is using HAās service: MQTT: Publish to write the new values.
If I perform a read
operation against {"cluster": "manuSpecificSinope", "attributes": ["flowMeterConfig"]}}
I can see the value is set to [0,0,0,0,0,0,0,0,1,0,0,0]
as expected.
But when passing in the following:
zigbee2mqtt/water_valve/set/write
{"cluster": "manuSpecificSinope", "payload": {"flowMeterConfig": [194,17,0,0,136,119,0,0,1,0,0,0]}}
Iām hitting the error:
z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"Publish 'set' 'write' to '0x500b91400003ecc3' failed: 'TypeError: ZCL command 0x500b91400003ecc3/1 manuSpecificSinope.write({\"flowMeterConfig\":[0,0,0,0,0,0,0,0,1,0,0,0]}, {\"timeout\":10000,\"disableResponse\":false,\"disableRecovery\":false,\"disableDefaultResponse\":true,\"direction\":0,\"srcEndpoint\":null,\"reservedBits\":0,\"manufacturerCode\":4508,\"transactionSequenceNumber\":null,\"writeUndiv\":false}) failed (Cannot read properties of undefined (reading 'length'))'","meta":{"friendly_name":"0x500b91400003ecc3"},"type":"zigbee_publish_error"}'
Is there something Iām missing in the payload to correctly write the new value?
try this
zigbee2mqtt/water_valve/set/write
{"cluster": "manuSpecificSinope", "payload": {"flowMeterConfig": [32,12,0,194,17,0,0,136,119,0,0,1,0,0,0]}}
The first part was missing for the array lenght
Hmm, Iām still getting the following error after trying
{"cluster": "manuSpecificSinope", "payload": {"flowMeterConfig": [32,12,0,194,17,0,0,136,119,0,0,1,0,0,0]}}
z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"Publish 'set' 'write' to '0x500b91400003ecc3' failed: 'TypeError: ZCL command 0x500b91400003ecc3/1 manuSpecificSinope.write({\"flowMeterConfig\":[32,12,0,194,17,0,0,136,119,0,0,1,0,0,0]}, {\"timeout\":10000,\"disableResponse\":false,\"disableRecovery\":false,\"disableDefaultResponse\":true,\"direction\":0,\"srcEndpoint\":null,\"reservedBits\":0,\"manufacturerCode\":4508,\"transactionSequenceNumber\":null,\"writeUndiv\":false}) failed (Cannot read properties of undefined (reading 'length'))'","meta":{"friendly_name":"0x500b91400003ecc3"},"type":"zigbee_publish_error"}'
Still the same error, the array length is not defined. There should be a parameter to add when we send that commande. Iāll check if I can find something.
Sorry to bother you again, just wondering if you had a chance to look for that parameter Iām missing? Iāve asked around on a few older Github issues and tried to find something in the zigbee-herdsman code base, but sadly no dice!
Try with
zigbee2mqtt/water_valve/set {"cluster": "manuSpecificSinope", "payload": {"flowMeterConfig": [194,17,0,0,136,119,0,0,1,0,0,0]}}
or
zigbee2mqtt/water_valve/set {"cluster": "manuSpecificSinope", "payload": {"flowMeterConfig": [32,12,0,194,17,0,0,136,119,0,0,1,0,0,0]}}
Try with
value: "{{ (states('sensor.otterburn_park_temperature') | float * 100) | int }}"
Hi,
Need a little help since iām a newbie. Valve isnāt supported in homebridge so I suppose there is a way to create a fake switch that reads and updates based on valve state and then export it to homekit?