Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95377

MQTT Publish does not continuously working with automation

$
0
0

@m4rk wrote:

Hello,

I have configured two automation with my motion sensor but its not working correctly.

The first should be turn on my light and my android tablet’s screen through the WallPanel application

- alias: Turn on dining room light when there is movement
  trigger:
    platform: state
    entity_id: binary_sensor.motion_sensor_158d000289f382
    to: 'on'
  action:
    service: light.turn_on
    entity_id: light.dining_room_light
  action:
    service: mqtt.publish
    data_template:
      topic: 'wallpanel/mywallpanel/command'
      payload: "{\"wake\": true}"
      retain: true
      qos: 2

The second automation just turn off the light if there is no movement:

- alias: Turn off dining room light 3 minutes after last movement
  trigger:
    platform: state
    entity_id: binary_sensor.motion_sensor_158d000289f382
    to: 'off'
    for:
      minutes: 3
  action:
    service: light.turn_off
    entity_id: light.dining_room_light

Issue: The first automation publish (mqtt) only once in ~10 minutes or it just not turning on my light. Could you help me what am I doing wrong?

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95377

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>