Problems to configure my Oregon sensor

@123 Looks like the mqtt string from Vera doesnt say oregon/Wind/gustspeed lke when we tested last time.

The mqtt message looks like this now.

Meddelande 1962 mottaget på Vera/Events/Vindsensor 220403 vid 22:44 :
{
“DeviceId”: 2880,
“DeviceName”: “Vindsensor 220403”,
“DeviceType”: “urn:schemas-micasaverde-com:device:WindSensor:1”,
“Direction”: 180,
“OldDirection”: 157,
“RoomId”: 14,
“RoomName”: “Utomhus”,
“ServiceId”: “urn:upnp-org:serviceId:WindSensor1”,
“Time”: 1682887441,
“Variable”: “Direction”
}
QoS: 0 - Retain: false

Meddelande 1961 mottaget på Vera/Events/Vindsensor 220403 vid 22:43 :
{
“AvgSpeed”: 0,
“DeviceId”: 2880,
“DeviceName”: “Vindsensor 220403”,
“DeviceType”: “urn:schemas-micasaverde-com:device:WindSensor:1”,
“OldAvgSpeed”: 0.27777777777778,
“RoomId”: 14,
“RoomName”: “Utomhus”,
“ServiceId”: “urn:upnp-org:serviceId:WindSensor1”,
“Time”: 1682887427,
“Variable”: “AvgSpeed”
}
QoS: 0 - Retain: false

Meddelande 1960 mottaget på Vera/Events/Vindsensor 220403 vid 22:43 :
{
“DeviceId”: 2880,
“DeviceName”: “Vindsensor 220403”,
“DeviceType”: “urn:schemas-micasaverde-com:device:WindSensor:1”,
“Direction”: 157,
“OldDirection”: 180,
“RoomId”: 14,
“RoomName”: “Utomhus”,
“ServiceId”: “urn:upnp-org:serviceId:WindSensor1”,
“Time”: 1682887427,
“Variable”: “Direction”
}
QoS: 0 - Retain: false

Meddelande 1959 mottaget på Will_Topic/ vid 22:43 :
testament_msg
QoS: 0 - Retain: false
Meddelande 1958 mottaget på Will_Topic/ vid 22:43 :
testament_msg
QoS: 0 - Retain: false

Meddelande 1957 mottaget på Vera/Events/Vindsensor 220403 vid 22:43 :
{
“AvgSpeed”: 1,
“DeviceId”: 2880,
“DeviceName”: “Vindsensor 220403”,
“DeviceType”: “urn:schemas-micasaverde-com:device:WindSensor:1”,
“OldAvgSpeed”: 0.83333333333333,
“RoomId”: 14,
“RoomName”: “Utomhus”,
“ServiceId”: “urn:upnp-org:serviceId:WindSensor1”,
“Time”: 1682887385,
“Variable”: “AvgSpeed”
}
QoS: 0 - Retain: false

Meddelande 1956 mottaget på Vera/Events/Vindsensor 220403 vid 22:43 :
{
“AvgSpeed”: 0.27777777777778,
“DeviceId”: 2880,
“DeviceName”: “Vindsensor 220403”,
“DeviceType”: “urn:schemas-micasaverde-com:device:WindSensor:1”,
“OldAvgSpeed”: 1,
“RoomId”: 14,

My configuration.yaml looks like this:

mqtt:
sensor:

- name: 'Average_Speed'
  unique_id: 'Average_Speed2'
  state_topic: 'oregon/wind/AvgSpeed'
  unit_of_measurement: 'm/s'
  value_template: '{{ (value_json.AvgSpeed / 3.6) | round(2) }}'

- name: 'Gust_Speed'
  unique_id: 'Gust_Speed'
  state_topic: 'oregon/wind/GustSpeed'
  unit_of_measurement: 'm/s'
  value_template: '{{ (value_json.GustSpeed / 3.6) | round(2) }}'

- name: 'Direction2'
  unique_id: 'Direction2'
  state_topic: 'oregon/wind/Direction'
  value_template:  >
    {% set directions = 
      { 12: 'Norr',
        35: 'Norr Norr Öst',
        57: 'Norr Öst',
        80: 'Öst Norr Öst',
        102: 'Öst',
        125: 'Öst Syd Öst',
        147: 'Syd Öst',
        170: 'Syd Syd Öst',
        192: 'Syd',
        215: 'Syd Syd Väst',
        237: 'Syd Väst',
        260: 'Väst Syd Väst',
        282: 'Väst',
        305: 'Väst Norr Väst',
        327: 'Norr Väst',
        349: 'Norr Norr Väst',
        360: 'Norr' } %}
    {{ directions.get(directions.keys() | select('>', value_json.Direction | int(0)) | first, 'Unknown') }}
 
- name: 'Current_Rain'
  unique_id: 'Current_Rain'
  state_topic: 'oregon/rain/CurrentRain'
  unit_of_measurement: 'mm/h'
  value_template: '{{ value_json.CurrentRain }}'
  
- name: 'Total_Rain'
  unique_id: 'Total_Rain'
  state_topic: 'oregon/rain/CurrentTRain'
  unit_of_measurement: 'mm'
  value_template: '{{ value_json.CurrentTRain }}'

Is that wrong??

Thanks for the additional information about the format of the MQTT topics published by Vera. Please also post the automation.

@123

alias: Auto-värden till vädersensornerna.
trigger:

  • id: rain
    platform: mqtt
    topic: Vera/Events/3050
  • id: wind
    platform: mqtt
    topic: Vera/Events/2880
    condition:
    action:
  • service: mqtt.publish
    data:
    topic: oregon/{{ trigger.id }}/{{ trigger.payload_json.Variable }}
    payload: “{{ trigger.payload_json | to_json }}”
    retain: true
    mode: queued

Based on the latest information you have provided, it appears that Vera is now publishing data to different MQTT topics.

For example, in the past it published wind data to:

Vera/Events/2880

However, now it appears to be publishing wind data to:

 Vera/Events/Vindsensor

Do you know if rain data is still published to:

Vera/Events/3050

Or has that also changed to something different?

I think it is published to Vera/Events/Regnsensor

regnsensor=rainsensor in swedish

So what exactly did you mean when you said the following one day ago?

Because it now seems to be that Vera isn’t publishing data to 2880 and 3050 but to Vindsensor and Regnsensor.

I meant Device id is 2880 and 3050.

Meddelande 374 mottaget på Vera/Events/Vindsensor 220403 vid 23:25 :
{
“DeviceId”: 2880,
“DeviceName”: “Vindsensor 220403”,
“DeviceType”: “urn:schemas-micasaverde-com:device:WindSensor:1”,
“Direction”: 135,
“OldDirection”: 112,
“RoomId”: 14,
“RoomName”: “Utomhus”,
“ServiceId”: “urn:upnp-org:serviceId:WindSensor1”,
“Time”: 1682889919,
“Variable”: “Direction”
}
QoS: 0 - Retain: false
Meddelande 373 mottaget på Vera/Events/Regnsensor220807 vid 23:25 :
{
“CurrentRain”: 160.52,
“DeviceId”: 3050,
“DeviceName”: “Regnsensor220807”,
“DeviceType”: “urn:schemas-micasaverde-com:device:RainSensor:1”,
“OldCurrentRain”: 83.84,
“RoomId”: 14,
“RoomName”: “Utomhus”,
“ServiceId”: “urn:upnp-org:serviceId:RainSensor1”,
“Time”: 1682889910,
“Variable”: “CurrentRain”
}
QoS: 0 - Retain: false

Change the topics in your automation’s two MQTT Triggers.

alias: Auto-värden till vädersensornerna.
mode: queued
trigger:
  - id: 'rain'
    platform: mqtt
    topic: Vera/Events/Regnsensor
  - id: 'wind'
    platform: mqtt
    topic: Vera/Events/Vindsensor
condition: []
action:
  - service: mqtt.publish
    data:
      topic: 'oregon/{{ trigger.id }}/{{ trigger.payload_json.Variable }}'
      payload: '{{ trigger.payload_json | to_json }}'
      retain: true
mode: queued

I have done that now. Now the rain is updating again. Thanks. Strange that Vera just changed the topic. Thanks for your patience and help. =) I missed the part with the automation where it de-multiplexes the received data and forwards it to unique MQTT topics. You told me last time, but my memory where lost.

Thanks for all help. You also helped me with a utility meter of all rain this year. That counter is overfull. Can I reset that in any way?

Found it.

@123 Hello! You helped me with this case so good. I have changed my rainsensor and its not showing the correct value. I were wondering if you could guide me how to multiply the value from the rainsensor with 2.5 before presenting in Home Assistant. Is it just to add *2,5 in the row “value template” for both CurrentRain and CurrentTrain?

That should work.