Can someone give me a hint how to present this MQTT data in Home assistant. I have added a sensor.yaml and I have the sensors in Home Assistant, but it says “not a numeric”.
I need to configure the sensor with the command value_template in correct way.
Im totally new for Yaml and learning from here.
I want to have 3 data from a Oregon Windsensor
Gustspeed, Averagespeed, Direction.
I want to have 2 values from a Oregon(PCR800) rainsensor:
Currentrain, Current totalt rain.
Here is my data from the Mqtt:
Meddelande 192 mottaget på Vera/Events/2879 vid 12:30 :
{
“CurrentRain”: 107.08,
“DeviceId”: 2879,
“DeviceName”: “Regnsensor 220403”,
“DeviceType”: “urn:schemas-micasaverde-com:device:RainSensor:1”,
“OldCurrentRain”: 200.45,
“RoomId”: 14,
“RoomName”: “Utomhus”,
“ServiceId”: “urn:upnp-org:serviceId:RainSensor1”,
“Time”: 1659695454,
“Variable”: “CurrentRain”
}
QoS: 0 - Retain: false
Meddelande 191 mottaget på Vera/Events/2879 vid 12:30 :
{
“CurrentTRain”: 326.8,
“DeviceId”: 2879,
“DeviceName”: “Regnsensor 220403”,
“DeviceType”: “urn:schemas-micasaverde-com:device:RainSensor:1”,
“OldCurrentTRain”: 302.4,
“RoomId”: 14,
“RoomName”: “Utomhus”,
“ServiceId”: “urn:upnp-org:serviceId:RainSensor1”,
“Time”: 1659695454,
“Variable”: “CurrentTRain”
}
QoS: 0 - Retain: false
Meddelande 45 mottaget på Vera/Events/2880 vid 11:40 :
{
“DeviceId”: 2880,
“DeviceName”: “Vindsensor 220403”,
“DeviceType”: “urn:schemas-micasaverde-com:device:WindSensor:1”,
“GustSpeed”: 4,
“OldGustSpeed”: 6,
“RoomId”: 14,
“RoomName”: “Utomhus”,
“ServiceId”: “urn:upnp-org:serviceId:WindSensor1”,
“Time”: 1659778819,
“Variable”: “GustSpeed”
}
QoS: 0 - Retain: false
Meddelande 44 mottaget på Vera/Events/2880 vid 11:40 :
{
“AvgSpeed”: 6,
“DeviceId”: 2880,
“DeviceName”: “Vindsensor 220403”,
“DeviceType”: “urn:schemas-micasaverde-com:device:WindSensor:1”,
“OldAvgSpeed”: 7,
“RoomId”: 14,
“RoomName”: “Utomhus”,
“ServiceId”: “urn:upnp-org:serviceId:WindSensor1”,
“Time”: 1659778819,
“Variable”: “AvgSpeed”
}
QoS: 0 - Retain: false
Meddelande 43 mottaget på Vera/Events/2880 vid 11:40 :
{
“DeviceId”: 2880,
“DeviceName”: “Vindsensor 220403”,
“DeviceType”: “urn:schemas-micasaverde-com:device:WindSensor:1”,
“Direction”: 225,
“OldDirection”: 292,
“RoomId”: 14,
“RoomName”: “Utomhus”,
“ServiceId”: “urn:upnp-org:serviceId:WindSensor1”,
“Time”: 1659778819,
“Variable”: “Direction”
}
HERE IS MY CURRENT Sensor.YAML:
-
platform: mqtt
state_topic: “#”
name: “AverageSpeed”
unique_id: Average_Speed
unit_of_measurement: ‘m/s’
value_template: “{{ input_number.AverageSpeed | float }}”
-
platform: mqtt
state_topic: “#”
name: “GustSpeed”
unique_id: Gust_speed
unit_of_measurement: ‘m/s’
value_template: “{{ input_number.GustSpeed | float }}”
-
platform: mqtt
state_topic: “#”
name: “Direction”
unique_id: Direction
value_template: “{{ input_number.Direction | float }}”
-
platform: mqtt
state_topic: “#”
name: “Current_Rain”
unique_id: Current_Rain
value_template: “{{ input_number.Current_Rain | float }}”
-
platform: mqtt
state_topic: “#”
name: “Total_Rain”
unique_id: Total_Rain
value_template: “{{ input_number.Total_Rain | float }}”