Hi,
I am trying to improve my presence detection and thought I would play around with the Bayesian binary sensor. I am doing something similar to this post
but instead of node-red i am using app-daemon. I have the baysien working fine but it creates a binary sensor, I am using appdaemon to convert that to a device tracker. From a state perspective it works great but I want the gravatar to appear on the new device tracker i create from the binary switch the Bayesian sensor creates
I have the following in appdaemon
class PresenceTracker(hass.Hass):
def initialize(self):
# Subscribe to sensors
self.listen_state(self.state_change_detected, self.args["binary_sensor"])
def state_change_detected(self, entity, attribute, old, new, kwargs):
if new == "on":
# Person is home so set device tracker to home
self.set_state(self.args["device_tracker"], state = "home", attributes = {"friendly_name": self.args["friendly_name"],"gravatar": self.args["gravatar"],"picture": self.args["gravatar"],"entity_picture":self.args["gravatar"] })
elif new == "off":
# Person is not home so set device tracker to away
self.set_state(self.args["device_tracker"], state = "not_home", attributes = {"friendly_name": self.args["friendly_name"],"gravatar": self.args["gravatar"],"picture": self.args["gravatar"],"entity_picture":self.args["gravatar"] })
the app.yaml is
presencetracker:
module: set_presence_tracker
class: PresenceTracker
binary_sensor: input_boolean.automation_test_sensor #<for testing will using binary sensor once working>
device_tracker: device_tracker.binary
friendly_name: "Scott"
gravatar: "https://www.gravatar.com/avatar/XXXXXXXX.jpg?s=80&d=wavatar"
the gravatar arg is a valid gravatar url that displays when i use the owntracks gravatar sensor by enering the email in the knowndevices.yaml. I have also tried the email address associated with this and it doesn’t work. It works in knowndevices.yaml