{"action":"created","issue":{"url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/536","repository_url":"https://api.github.com/repos/arendst/Sonoff-Tasmota","labels_url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/536/labels{/name}","comments_url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/536/comments","events_url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/536/events","html_url":"https://github.com/arendst/Sonoff-Tasmota/issues/536","id":237720347,"number":536,"title":"Mosquitto + Home Assistant + Tasmota","user":{"login":"dariosm","id":10993953,"avatar_url":"https://avatars2.githubusercontent.com/u/10993953?v=3","gravatar_id":"","url":"https://api.github.com/users/dariosm","html_url":"https://github.com/dariosm","followers_url":"https://api.github.com/users/dariosm/followers","following_url":"https://api.github.com/users/dariosm/following{/other_user}","gists_url":"https://api.github.com/users/dariosm/gists{/gist_id}","starred_url":"https://api.github.com/users/dariosm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dariosm/subscriptions","organizations_url":"https://api.github.com/users/dariosm/orgs","repos_url":"https://api.github.com/users/dariosm/repos","events_url":"https://api.github.com/users/dariosm/events{/privacy}","received_events_url":"https://api.github.com/users/dariosm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-06-22T03:10:24Z","updated_at":"2017-06-22T21:04:33Z","closed_at":null,"body":"I've been adjusting many configuration and parameter values to make the integration possible. The setup is actually quite straightforward and widely discussed out there, but I had some issues regarding inconsistent states (sonoff relay, mosquitto retained messages and HASS toggle indicators). That might be due to bad combination of parameters like `retain` in `light` or `switch` configuration in HASS, `persistence` in Mosquitto and `PowerOnState`, `PowerRetain` and maybe `SetOptionx` in Tasmota.\r\n\r\nThis is my mqtt and a light configuration in HASS:\r\n```\r\nmqtt:\r\n  broker: 127.0.0.1\r\n  port: 1883\r\n  client_id: home-assistant\r\n  keepalive: 60\r\n  protocol: 3.1\r\n  birth_message:\r\n    topic: \"tele/hass/LWT\"\r\n    payload: \"Online\"\r\n    qos: 1\r\n    retain: true\r\n  will_message:\r\n    topic: \"tele/hass/LWT\"\r\n    payload: \"Offline\"\r\n    qos: 1\r\n    retain: true\r\n\r\nlight:\r\n  - platform: mqtt\r\n    name: \"Couch\"\r\n    state_topic: \"stat/sonoff1/POWER\"\r\n    command_topic: \"cmnd/sonoff1/POWER\"\r\n    payload_on: \"ON\"\r\n    payload_off: \"OFF\"\r\n    retain: true\r\n    optimistic: false\r\n```\r\n\r\nThis are the command results that I consider relevant to this matter:\r\n```\r\n03:59:41 CMND: PowerOnState\r\n03:59:41 MQTT: stat/sonoff1/RESULT = {\"PowerOnState\":3}\r\n03:59:44 CMND: PowerRetain\r\n03:59:44 MQTT: stat/sonoff1/RESULT = {\"PowerRetain\":\"ON\"}\r\n03:59:48 CMND: SetOption\r\n03:59:48 MQTT: stat/sonoff1/RESULT = {\"SetOption1\":\"OFF\"}\r\n03:59:51 CMND: SetOption0\r\n03:59:51 MQTT: stat/sonoff1/RESULT = {\"SetOption0\":\"ON\"}\r\n```\r\nI'm using `5.1.7` `Build 2017-06-16T12:56:44`\r\n\r\nI wonder what is the optimal configuration for the integration. Is light.retain (HASS) needed to preserve the state of the relay, or should this be handled by properly setting PowerOnState and savedata (Tasmota)? Is persistence (Mosquitto) needed to allow HASS recover the current light values (sonoff relay state) on every restart?\r\n\r\nThanks in advance"},"comment":{"url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/comments/310502229","html_url":"https://github.com/arendst/Sonoff-Tasmota/issues/536#issuecomment-310502229","issue_url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/536","id":310502229,"user":{"login":"davidelang","id":2208335,"avatar_url":"https://avatars2.githubusercontent.com/u/2208335?v=3","gravatar_id":"","url":"https://api.github.com/users/davidelang","html_url":"https://github.com/davidelang","followers_url":"https://api.github.com/users/davidelang/followers","following_url":"https://api.github.com/users/davidelang/following{/other_user}","gists_url":"https://api.github.com/users/davidelang/gists{/gist_id}","starred_url":"https://api.github.com/users/davidelang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidelang/subscriptions","organizations_url":"https://api.github.com/users/davidelang/orgs","repos_url":"https://api.github.com/users/davidelang/repos","events_url":"https://api.github.com/users/davidelang/events{/privacy}","received_events_url":"https://api.github.com/users/davidelang/received_events","type":"User","site_admin":false},"created_at":"2017-06-22T21:04:33Z","updated_at":"2017-06-22T21:04:33Z","body":"subscribing to a message just means that when the message is sent, you get a \ncopy of it. How does that query for a status when a message hasn't been sent?\n"}}
{"actor":{"display_login":"davidelang"}}