Dear HomeAssistant assistants,
I am having trouble getting the configurations right for my temperature and humidity sensors. The issue with me is, that I cannot connect sensor time to each temperature or humidity value.
Apologies, if this question was already asked or is explained in the documentation. I just couldn’t find it.
Here is what I receive via mqtt:
{"time" : "2024-10-15 12:49:12", "model" : "Ambientweather-F007TH", "id" : 29, "channel" : 6, "battery_ok" : 1, "temperature_C" : 20.722, "humidity" : 63, "mic" : "CRC"}
My non-working configuration looks like:
sensor:
- name: "Time Balcony"
unique_id: "time_balkon"
state_topic: "mqtt/sensors/balcony"
value_template: "{{ value_json.time | as_datetime | as_local }}"
- name: "Temperature Balcony"
unique_id: "temperature_balcony"
state_topic: "mqtt/sensors/balcony"
state_class: "measurement"
unit_of_measurement: "°C"
value_template: "{{ value_json.temperature_C }}"
- name: "Humidity Balcony"
unique_id: "humidity_balcony"
state_topic: "mqtt/sensors/balcony"
state_class: "measurement"
unit_of_measurement: "%"
value_template: "{{ value_json.humidity }}"
- name: "battery balcony"
unique_id: "battery_balcony"
device_class: "binary_sensor"
state_topic: "mqtt/sensors/balcony"
value_template: "{{ value_json.battery_ok }}"
Can someone please guide me on how to set this up properly?