{"action":"created","issue":{"url":"https://api.github.com/repos/OttoWinter/esphomelib/issues/143","repository_url":"https://api.github.com/repos/OttoWinter/esphomelib","labels_url":"https://api.github.com/repos/OttoWinter/esphomelib/issues/143/labels{/name}","comments_url":"https://api.github.com/repos/OttoWinter/esphomelib/issues/143/comments","events_url":"https://api.github.com/repos/OttoWinter/esphomelib/issues/143/events","html_url":"https://github.com/OttoWinter/esphomelib/issues/143","id":359259907,"node_id":"MDU6SXNzdWUzNTkyNTk5MDc=","number":143,"title":"Template Binary sensor causing loop","user":{"login":"barryodonovan","id":8092518,"node_id":"MDQ6VXNlcjgwOTI1MTg=","avatar_url":"https://avatars3.githubusercontent.com/u/8092518?v=4","gravatar_id":"","url":"https://api.github.com/users/barryodonovan","html_url":"https://github.com/barryodonovan","followers_url":"https://api.github.com/users/barryodonovan/followers","following_url":"https://api.github.com/users/barryodonovan/following{/other_user}","gists_url":"https://api.github.com/users/barryodonovan/gists{/gist_id}","starred_url":"https://api.github.com/users/barryodonovan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barryodonovan/subscriptions","organizations_url":"https://api.github.com/users/barryodonovan/orgs","repos_url":"https://api.github.com/users/barryodonovan/repos","events_url":"https://api.github.com/users/barryodonovan/events{/privacy}","received_events_url":"https://api.github.com/users/barryodonovan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-11T23:26:25Z","updated_at":"2018-11-27T21:37:06Z","closed_at":"2018-11-27T21:37:06Z","author_association":"NONE","body":"Template Binary Sensor is causing a loop during (mqtt?) setup on an ESP32 for me.\r\n\r\nThe code causing the issue is:\r\n```\r\nsensor:\r\n  - platform: adc\r\n    pin: GPIO32\r\n    name: \"Pellet Hopper Light\"\r\n    id: pellethopperlight\r\n    update_interval: 60s\r\n    attenuation: 6db\r\n\r\nbinary_sensor:\r\n  - platform: template\r\n    name: \"Pellet Hopper Level\"\r\n    device_class: problem\r\n    lambda: >-\r\n      if (id(pellethopperlight).value > 0.2) {\r\n        return true;\r\n      } else {\r\n        return false;\r\n      }\r\n```\r\n\r\nAfter complilation and uploading the logs show multiple recurring MQTT setup debug output,  on my frontend sensors flick to/from unavailable states. No values appear to be polled and none are returned.\r\n\r\nIf I exclude the binary_sensor, the code runs correctly and the light levels are returned as expected."},"comment":{"url":"https://api.github.com/repos/OttoWinter/esphomelib/issues/comments/442226372","html_url":"https://github.com/OttoWinter/esphomelib/issues/143#issuecomment-442226372","issue_url":"https://api.github.com/repos/OttoWinter/esphomelib/issues/143","id":442226372,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjIyNjM3Mg==","user":{"login":"OttoWinter","id":6833237,"node_id":"MDQ6VXNlcjY4MzMyMzc=","avatar_url":"https://avatars1.githubusercontent.com/u/6833237?v=4","gravatar_id":"","url":"https://api.github.com/users/OttoWinter","html_url":"https://github.com/OttoWinter","followers_url":"https://api.github.com/users/OttoWinter/followers","following_url":"https://api.github.com/users/OttoWinter/following{/other_user}","gists_url":"https://api.github.com/users/OttoWinter/gists{/gist_id}","starred_url":"https://api.github.com/users/OttoWinter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OttoWinter/subscriptions","organizations_url":"https://api.github.com/users/OttoWinter/orgs","repos_url":"https://api.github.com/users/OttoWinter/repos","events_url":"https://api.github.com/users/OttoWinter/events{/privacy}","received_events_url":"https://api.github.com/users/OttoWinter/received_events","type":"User","site_admin":false},"created_at":"2018-11-27T21:37:06Z","updated_at":"2018-11-27T21:37:06Z","author_association":"OWNER","body":"Closing this issue as I can't reproduce it..."}}
{"actor":{"display_login":"OttoWinter"}}