Created
April 22, 2021 08:21
-
-
Save oki/70ede6a04a8e2e0309f0a7d6c7b0caf9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
events_forwarder: | |
module: events_forwarder | |
class: EventsForwarder | |
entities: | |
# - binary_sensor.aqara_door_1_contact | |
# - binary_sensor.debug_contact | |
# - sensor.aqara_multi_outdoor_temperature | |
- sensor.day_night_custom | |
- sensor.zwift_online_1013655 | |
- binary_sensor.aqara_water_rain_water_leak | |
- sensor.raingauge_tips | |
# - light.kotlownia |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import appdaemon.plugins.hass.hassapi as hass | |
import requests | |
class EventsForwarder(hass.Hass): | |
def initialize(self): | |
self.log("Hello from AppDaemon Events forwarder") | |
self.log( self.args["entities"] ) | |
for entity in self.args["entities"]: | |
self.listen_state(self.forward_event, entity) | |
def forward_event(self, entity, attribute, old, new, kwargs): | |
# self.log("Changed!!! [state]") | |
# self.log(entity) | |
# self.log(attribute) | |
# self.log(old) | |
# self.log(new) | |
if old != "unknown": | |
requests.post('http://000.000.00.00:0000/ha_events_slack_bot_this_is_only_fyi', json={"entity": entity}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment