MQTT Client Plugin

the sensor in Vera:
image

automation in Home Assistant:

  • alias: mqtt
    initial_state: true
    trigger:
    • platform: state
      entity_id: sensor.multi_sensor
      action:
    • service: mqtt.publish
      data:
      topic: xxx/xxx/xxx
      payload_template: “{{ states.sensor.multi_sensor.state }}”

Configuration like this: "{"temperature “:“15.2”}” where 15.2 needs to be replaced with {{ states(‘sensor.temperature’) }} is not valid.

Not working.

Can you help me?

try this for payload_template: {“temperature”: “{{states.sensor.multi_sensor.state}}”} i just tried it on my setup and it works.

Works.
Thank you very much for your help and your precious time.

You are welcomed.

Hello again
I would need help getting the status of a switch from Home Assistant.

I tried to use the information below but failed.

Topic  : Test/#
Target: urn:upnp-org:serviceId:SwitchPower1,Status=payload.value and ((payload.value=="alarm") and "1" or "0")

On a message from topic ‘Test/Something’ with payload ‘{“value”:“alarm”}’, the switch will be powered on.

1 Like

Why would you make a mqtt switch from HA to Vera? Just use the Switchboard plugin and you will have virtual switches appear in Home Assistant

Ok. Thanks!

Hello,

i’m trying to connect motion sensor to vera via MQTT. The issue is that the device that is sending the MQTT has fixed payload and its eather True or False and i can’t change it to send Status:1 or Status:0, does anybody know how to modify mqttTarget variable so it can translate The True value to trip the sensor and false to untrip?

Thanks

Found a solution

mqttTarget: urn:micasaverde-com:serviceId:SecuritySensor1,Tripped=payload and ((payload==“True”) and “1” or “0”)

Cheers

Could you share a working HA example using http?

What you want to achieve to send temperature to vera or something else? If its a temperature than make a rest command in rest.yaml

temp_outdoor:
  url: 'http://192.168.0.82:3480/data_request?id=variableset&DeviceNum=1059&serviceId=urn:upnp-org:serviceId:TemperatureSensor1&Variable=CurrentTemperature&Value={{ temp }}'
  method: get

Change the name of the command, ip address of vera and device number

Than make an automation where trigger will be the temperature sensor, in from and to field leave it blank

In action chose edit in yaml and put the following code:

 data_template:
   temp: '{{ states.sensor.name_of_sensor.state }}'
 service: rest_command.name_of_command

This should work

Thanks for attending to my request which is appreciated. However, sofar no luck in getting the value across to my vera for which the following applies:

Automation- rest.yaml file

  • alias: ‘Vera Sync’
    trigger:
    platform: state
    entity_id: sensor.temperature
    action:
    service: rest_command.vera_temp_outdoor
    data_template:
    temp: ‘{{ states.sensor.temperature.state }}’

Sensor- vera_rest.yaml file

rest_command:
vera_temp_outdoor:
url: “http://192.168.178.31:3480/data_request?id=variableset&DeviceNum=149&serviceId=urn:upnp-org:serviceId:TemperatureSensor1&Variable=CurrentTemperature&Value={{ temp }}”
method: get

Using the URL with dummy value for “temp” gets the value across to the vera. Hence, the error is in my coding. Any suggestion?

I’m sorry but using the Ctrl+Shift+C does not render preformatted text. No idea why!

When you put ‘{{ states.sensor.temperature.state }}’ in Developer Tools → Template does it show a value?

here is some similar automation that i have at the moment:

maybe it will help with the formatting. The one that i used for outdoor temperature i dont use it any more but the automation is the same

Thanks a lot, got it working. In further checking it transpired that the service was not listed under Developer Tools - Services. This was because the rest_command was accommodated under the sensor directory. After putting it in the configuration.yaml, all works fine. Thanks again for sharing and thinking along with me.
Enjoy!

hello gang
im not able to create variables “mqttTarget” and “mqttTopic” i dont no want am doing wrong



Hi there,

Has anyone used any of these apps to be able to retrieve power readings from a Shelly Em? If so, would really appreciate config details.

Thanks in advance

can any plugin run?

Anyone who can help me with what to config in Home assistant to get the values from rain and wind sensor configured in Vera?
I can see the values in the CONFIG/MQTT settings in HA.
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”
}

Trying to get the data for the sensor like this in HA’.

  • platform: mqtt
    state_topic: ‘Vera/Events/2879’
    name: “CurrentRain”
    unique_id: Current_Rain
    value_template: “{{ value_json.currentrain | float }}”

  • platform: mqtt
    state_topic: ‘Vera/Events/2879’
    name: “CurrentTRain”
    unique_id: Total_Rain
    value_template: “{{ value_json.currentTrain | float }}”

My sensor only says “Unknown”.

sorry i cant see this screenshot. can you readd please?