hi rob,
the examples i give are also working, just like the examples you mention.
the examples included in the appdaemon install are a bit more complicated, so they could be used in a future part.
i did include yaml and translated that.
i showed how this automation in yaml
automation:
- alias: " Turn on light when input boolean is switched on and someone is home"
trigger:
platform: state
entity_id: input_boolean.some_choice
state: 'on'
condition:
condition: state
entity_id: device_tracker.some_mobile
state: 'home'
action:
service: light.turn_on
entity_id: light.some_light
would be translated to this working app
import appdaemon.appapi as appapi
class your_class_name(appapi.AppDaemon):
def initialize(self):
self.listen_state(self.what_we_want_to_do,"input_boolean.some_choice", new="on")
def what_we_want_to_do (self, entity, attribute, old, new, kwargs):
a_variabele_with_a_usable_name = self.get_state("device_tracker.some_mobile")
if a_variabele_with_a_usable_name == "home":
self.turn_on("light.some_light")
i have written this for people who have at least some basic understanding from home assistant.
so i expect people to see input_boolean.some_choice and device_tracker.some_mobile as normal homeassistant entities.
if people dont have enough knowledge from HA basics like entities, then appdaemon isnt an option anyway.
in that what you are trying out, there are a few problems i mentioned in the tutorial too.
class HelloWorld(appapi.AppDaemon):
def initialize(self):
self.listen_state(fancontrol)
if self.get_state("sensor.fan") > 30:
self.turn_on("switch.fan")
else:
self.turn_off("switch.fan")
indention:
that what comes on the next line should be indented if it belongs to the line above, if not it should have the same indention (it is possible to use tabs, but like tuboc mentioned, better to avoid it. if you use it you should use it contiously the same way) (this is basic python, for more information about indention in python i would advice seaching for it on google).
the basic parts from the tutorial:
the trigger:
in your case your temperature sensor so that would make it:
self.listen_state(self.what_we_want_to_do, "sensor.dht_sensor_temperature" )
then the action which would start with:
def what_we_want_to_do (self, entity, attribute, old, new, kwargs):
so that would change your app from::
class HelloWorld(appapi.AppDaemon):
def initialize(self):
self.listen_state(fancontrol)
if self.get_state("sensor.fan") > 30:
self.turn_on("switch.fan")
else:
self.turn_off("switch.fan")
to:
class HelloWorld(appapi.AppDaemon):
def initialize(self):
self.listen_state(self.what_we_want_to_do, "sensor.dht_sensor_temperature" )
def what_we_want_to_do (self, entity, attribute, old, new, kwargs):
if new > 30:
self.turn_on("switch.fan")
else:
self.turn_off("switch.fan")
to make sure it doesnt go on and of and on and off again you could change that to:
class HelloWorld(appapi.AppDaemon):
def initialize(self):
self.listen_state(self.what_we_want_to_do, "sensor.dht_sensor_temperature" )
def what_we_want_to_do (self, entity, attribute, old, new, kwargs):
if new > 30:
self.turn_on("switch.fan")
if new < 29:
self.turn_off("switch.fan")
i hope that this helps you to understand things more.
by the way, thanks for making me have a closer look to the first app again, i see that i forgot a small part there 
@Tinkerer i will check into the colors. (i am partly colorblind so i see colors different
)