Hello,
how can I create entities from the “Sensor” row in Yaml?
Unfortunately I don’t know my way around here.
Thanks
Read this and attempt to implement a new sensor.
Share what you tried as text correctly formatted for the forum (not a screenshot).
Thank you for the answer. I’ve already discovered the page, but unfortunately I don’t know how to remove the values from this long line.
SENSOR = {“Time”:“2024-12-07T06:04:30”,“DTZ”:{“E_in”:13283.0,“E_in1”:11783.9,“E_out”:4616.0,“Power”:481,“volt_p1”:231.0,“volt_p2”:230.2,“volt_p3”:230.3,“amp_p1”:0.7,“amp_p2”:1.3,“amp_p3”:1.1,“phase_angle_l2_l1”:119.0,“phase_angle_l3_l1”:239.0,“phase_angle_p1”:309.0,“phase_angle_p2”:318.0,“phase_angle_p3”:308.0,“freq”:50,}}
I’ll try it like this
- name: "Power"
state_topic: "tele/tasmota_B172F8/SENSOR"
value_template: "{{ value_json.Power }}"
unit_of_measurement: "W"
or this
- name: "Power"
state_topic: "tele/tasmota_B172F8/SENSOR"
value_template: "{{ Power(value) }}"
unit_of_measurement: "W"
but noting works.
Unfortunately, I don’t understand enough about it
maybe someone can help me
You have the correct topic but just missed part of the json path, you nearly had it. Try this:
- name: "Power"
state_topic: "tele/tasmota_B172F8/SENSOR"
value_template: "{{ value_json.DTZ.Power }}"
unit_of_measurement: "W"
device_class: power
state_class: measurement
In future you can use this site to find your data: https://jsonpathfinder.com/
thank you very much for your help. Unfortunately that still didn’t work. When I select the entity there is no value but “unknow”
Do you have another idea?
Did you restart or reload after creating the sensor?
Where did you put the sensor config?
Are there related errors in Settings → System → Logs ?
Yes. I restart after every attempt. “developer tools” - “check configuration” - then “reload YAML configuration”. Now I have even restarted completely
I wrote it in the file editor under “/homeassistant/configuration.yaml”.
My other sensors from the VBUS reader work
mqtt:
sensor:
- name: “Solarthermie Plattentemperatur”
state_topic: “vbus2mqtt/house/panel_temp”
value_template: “{{ (value) }}”
unit_of_measurement: “°C”
- name: "Solarthermie Speicher Temperatur unten"
state_topic: "vbus2mqtt/house/buffer_bot"
value_template: "{{ (value) }}"
unit_of_measurement: "°C"
- name: "Solarthermie Pumpe"
state_topic: "vbus2mqtt/house/pumps"
value_template: "{{ (value) }}"
unit_of_measurement: "%"
- name: "Solarthermie Betriebsdauer"
state_topic: "vbus2mqtt/house/Operating hours 1"
value_template: "{{ (value) }}"
unit_of_measurement: "h"
- name: "Solarthermie VBUS Apapter"
state_topic: "vbus2mqtt/house/LWT"
value_template: "{{ (value) }}"
- name: "Power"
state_topic: "tele/tasmota_B172F8/SENSOR"
value_template: "{{ value_json.DTZ.Power }}"
unit_of_measurement: "W"
device_class: power
state_class: measurement
oh. in Settings → System → Logs there are many warnings and errors, but none related to this
find no error. In mqtt explorer it also shows the value
I did a test with my VBUS connection. this one worked
- name: "TEST VBUS"
state_topic: "vbus2mqtt/house/sensors"
value_template: "{{ value_json.temperatures.buffer.bot }}"
unit_of_measurement: "W"
device_class: power
state_class: measurement
I think the problem is that I have two connections in MQTT Explorer and it only listens on one.
could that be the problem?
Yes. Home Assistant can only connect to one mqtt broker. Search the forum for “bridge mqtt brokers”.
Now I have swapped the MQTT connections. Now the Homeassistant MQTT connection and the VBUS connection don’t work.
I tried with the MQTT bridge, but there’s something wrong with the setting.
I created a file VBUS.conf.
in “add ons” - “mossquitto broker” - “protocol” it brings up the following message
024-12-08 20:58:55: Connecting bridge VBUS (192.xxx.xxx.xxx:xxx)
2024-12-08 20:58:55: Client local.mqtt-xxxxxxxxxxxxxx disconnected: Broken pipe.
" Failed to get core_mosquitto logs, Error in input stream "
Unfortunately I can’t find a solution here
Have you considered using only one broker?
ah, that works too
Now I think I understand the MQTT. I have now created an mqtt user and more or less reconfigured everything. Now everything goes through a broker.
Thank you very much for your help!