Announcement: Occupancy Simulator for AppDaemon v 1.1.0

Ok, clear! Thats what I would expect. Thanks.

@aimc Hi Andrew, been using this now successfully for some time. Thanks for this great app!

Is there also a way to DIM lights instead of just turning on/off? Almost all my lights are dimmable and my house is now super brights when I’m gone…

You can use scenes instead of lights to set things exactly the way you want them - that’s what I do.

Ok, will do that!

Just one extra Q: Do I need to build an ON and an OFF scene? Or will a step_day_off_2 = scene.sfeer turn the scene off (eg no need to build and extra seen that switches off the lights in the scene.

I see it mentioned in the documentation but want to double check as I always build off scenes as well.

It’s up to you - in the case of scenes, on and off steps both activate the scene since there is no real concept of turning a scene off, just replacing a previous scene. So I have scenes for my evening setup, scenes to turn all the downstairs lights off etc.

I’m confused by the “config files” . I created the appdaemon.yaml file for the AppDaemon environment and got the “hello Word” app to run, and it reports a successful connection to HA. Is there a different config file – with a .cfg extension for the occusim environment? Do you list occusim as one of the apps in the AppDaemon.yaml file – and then have another .cfg file for the occusim statements? If I put the occusim control statements into the yaml file I get parsing errors. What did I miss?

A couple of releases ago I moved the AppDaemon config file from .cfg to yaml - I haven’t updated the occusim docs yet but it should be a simple manual conversion.

I am planning an occusim v2 at some point which will have updated docs but will also use the additional power the YAML format gives.

Good morning-- Andrew - thanks for creating this package – I appear to have the AppDaemon environment working OK. What I’m stuck on is how to “add in” the occusim application & Control statements.
I have done the git clone and put the occusim.py in the appdaemon’s app directory.
Here is my appdaemon.yaml file - right now I’m getting parsing errors on the log statement - expecting “:”
Do the occusim control statements need to be in “yaml” format as well?
indent preformatted text by 4 spaces
AppDaemon:
logfile: STDOUT
errorfile: STDERR
threads: 10
cert_verify: False
HASS:
ha_url: http://192.xxxxxxxxxx
ha_key: xxxxxxxx

Apps

hello_world:
module: hello
class: HelloWorld

occupancy_Simulator:
module: occusim
class: OccuSim

log = 1
logfile = /etc/appdaemon/logs/appdaemon.log

random_garage_name = in_garage
random_garage_start = 21:00:00
random_garage_end = 23:30:00
random_garage_minduration = 00:03:00
random_garage_maxduration = 00:09:00
random_garage_number = 3
random_garage_on_1 = light.garage_ceiling_light
random_garage_off_1 = light.garage_ceiling_light
indent preformatted text by 4 spaces

Yes, you need to do a manual conversion to yaml - basically replace the “=” with “:” and make sure the indentaion is correct

I am using docker to deploy my HA and AppDaemon setup. Ideally this would live as a git submodule within my server config repo. The need to copy occusim.py makes this hard to do. I could perhaps clone it somewhere else in my repo and commit the symlink… What are your thoughts here? Or maybe it would be better to move this to the AppDaemon project and suggest allowing apps to be folders under the apps/ dir?

LOL, looks like this was already requested and JustWorks™. https://github.com/home-assistant/appdaemon/issues/10

Can I use an input select rather than an input boolean for the enable parameter? I’d like OccuSim to be enabled for two out of three input select options.

It didn’t … but i just added it as a new year’s present. The hard part is that I didn’t test it, so let me know if it works OK :wink:

Thanks, got it set up and I’ll do some testing. :+1:
Happy New Year!

1 Like

Does anyone got OccuSim work on AD 4.0.1 ? Lights are not switching on/off and I get a lot:

2020-02-26 18:22:26.019786 WARNING Occupancy Simulator: non_existent namespace (default) specified in call to turn_off

You probably set the namespace for HASS to something different from default. Change the namespace of HASS in your appdaemon.yaml to default and see if the error disappears.

plugins:
    HASS:
      type: hass
      namespace: default

But there might be other issues with change from AD 3 to AD 4, I can’t tell as I don’t use it.

You’re right, the namespace was missing from my config file… thanks for the help !