Esp8266-01 irregular light switching on off

Dear members,
Since a few days I am trying to get to grips with Hassio. Got MQTT working. But while running the Raspi 3B+ server my ESP8266-01 controlled light just starts when it feels like it. Until now I have not noticed it switching off, just on.
I can still control it from the web page.

Anyone an idea what is going on?

The config part looks like this:
light:

  • platform: mqtt
    name: Lamp1 Serre
    command_topic: “cmnd/sonoff1/POWER1”
    state_topic: “stat/sonoff1/RESULT”
    value_template: “{{ value_json.POWER1 }}”
    availability_topic: “tele/sonoff1/LWT”
    qos: 1
    payload_on: “ON”
    payload_off: “OFF”
    payload_available: “Online”
    payload_not_available: “Offline”
    retain: true

See that blue bar on top? can you use it to format your code?
also where is value_template: “{{ value_json.POWER1 }}” coming from? it’s not a valid option for mqtt lights, you probably want to remove it first.
(Once you’re on 0.89.x it will warn you about it anyway)

Thank you very much for the insight and advice. I’m sorry to say it does not remedy the behaviour. And I am on 0.89.1 fyi and have not seen a warning.

pablok

Do you get anything in the logs?

Thanks for asking.
After a few days of absence and having switched off the server, this morning I started the server again to answer your question.
The light came on unexpectedly and the lightning sign - which I had not seen before - showed the light as off. In HA I switched it on and off again. Now it is off and shows itself as off.
So yes, it now shows in the logs. Meanwhile I am updating to version 0.9.
Furthermore, seeing the log for a week, there are several mentions ’ Lamp1 Serre changed to unavailable’. These might have been the irregular switching to ON.
So, the question seems to be, where and how can I ‘trim’ the behaviour when a lamp signals its status as unavailable?

Thanks in advance,
pablok

If the light came on unexpectedly, maybe you’ve set the retain flag to true and that overrides the light’s status? worth trying with retain=false or 0…

Thank you! I was wondering if I should change that.
Going to test it. Will report back soon.

pablok

Well, after about 12 hours without an irregular flash of lamp light it seems my problem is solved with a configuration setting of remain = false.

So thank you lolouk44 for taking the time to help me out. :laughing:

pablok

1 Like