#not without seeing the template
1 messages ยท Page 1 of 1 (latest)
sensor:
- name: "Wasser"
state_topic: "wasserzaehler/main/value"
value_template: "{{ value }}"
unit_of_measurement: "m3"
icon: "mdi:water"
- name: "Wasser timestamp"
state_topic: "wasserzaehler/main/timestamp"
value_template: "{{ value }}"
icon: "mdi:clock-outline"
binary_sensor:
- name: "Wasser error"
state_topic: "wasserzaehler/main/error"
value_template: "{{ value != 'no error' }}"
json_attributes_topic: "wasserzaehler/main/json"
icon: "mdi:alert-circle"```
the error template does not match somehow
looks like you need "{{ value.error != 'no error' }}"
can you copy/paste the attriutes from the more detailed entity overview in devtools > states
nah, that should be covered by the mqtt topic path
raw: '00450.9311'
error: 'Rate too high - Read: 450.9311 - Pre: 450.7517'
rate: ''
timestamp: '2022-09-27T05:49:45'
icon: mdi:alert-circle
friendly_name: Wasser error```
that is the yaml content
Well the vaule is empty
I meant json
wasserzaehler/main/json
but wasserzaehler/main/error is supposed to just deliver the error string
as value
or am I completely off?
I could of course change it and do json template resolving
the part you posted above shows the value as ''
yes, but that comes from the json_attributes_topic right?
not from the value template
in the template resolver teh value shoudl be whatever is in the /error ...
ah right
I am currently in the wrong network so I can't access the mqtt server ๐ฆ
oh, but I could just write the value directly to the sensor
... now I'm confused
by - name: "Wasser errortext" state_topic: "wasserzaehler/main/error" value_template: "{{ value }}" icon: "mdi:alert-circle"
the value is clearly there.... or does the json attribute thingy overwrite it?
then why is it unknown instead of true/false...
oh
mqtt:
binary_sensor:
- state_topic: "lab_button/cmnd/POWER"
value_template: "{%if is_state(entity_id,\"on\")-%}OFF{%-else-%}ON{%-endif%}"``` from the webpage, it seems like mapping of boolean to BINARY SENSOR does not work out of the box
I think I could work around that by using payload_on and payload_off
no problem, it helps a lot to have someone to bounce ideas off of

https://i.imgur.com/1OgtnH1.png it works