Occupancy simulator installation

did you read this?

Problem solved…
In my apps.yaml… it works fine only if I use double quotes…

Occupancy Simulator:
  class: OccuSim
  module: occusim
  log: 1
  notify: 1
  enable: input_boolean.systemalarm_away,on
  dump_times: 1
  reset_time: 00:00:00

  step_starttime_name: Start_time
  step_starttime_start: "16:00:00"

  step_stoptime_name: Stop_time
  step_stoptime_start: "23:59:59"

  random_awaying_name: Lights_away_ing
  random_awaying_start: Start_time
  random_awaying_end: Stop_time
  random_awaying_minduration: "00:00:30"
  random_awaying_maxduration: "00:01:00"
  random_awaying_number: "30"
  random_awaying_on_1: switch.sonoff_ing
  random_awaying_off_1: switch.sonoff_ing
1 Like

My configuration of Occusim start with the event

enable: input_boolean.systemalarm_away,on

when my alarm system turn in away mode.

But… when my alarm system will switch in disarmed mode Occusim will be stopped itself?

if the input_boolean.systemalarm_away is turned to off the occusim app wont do his job.

OK
Many thanks @ReneTode you are always very helpfull :slightly_smiling_face::+1:

1 Like

Now I have these warnings every 10 minutes in Appdaemon log:

2018-10-30 17:44:48.023986 WARNING AppDaemon: Excessive time spent in utility loop: 994.0ms
2018-10-30 17:54:49.922680 WARNING AppDaemon: Excessive time spent in utility loop: 1797.0ms
2018-10-30 18:04:51.105262 WARNING AppDaemon: Excessive time spent in utility loop: 1063.0ms

that means that AD does need more time then the expected 1 second to update the data from HA to AD.
you probably have AD connected to an outside HA url (like duckdns) and that means that all your data goes on the internet every time, and that slows things down.

the only way to avoid that is to connect to the local IP adress from HA, but thats only possible if you dont connection to your DNS and encryption inside HA.

I use integration with Google Assistant then I need a secure connection via Duckdns and NGINX

if you use NGINX then you have a proxy server for the outside connection.
so you should also be able to connect HA locally. (without going through nginx)

something like http://your_HA_IP:your_HA_port
and with hassio you can use something like http://hassio/homeassistant

its even in your own logs (again logs are very IMPORTANT!)

WARNING: You are using an non-recommended Home Assistant URL!
WARNING: Setting the "ha_url" option in your AppDaemon config to
WARNING: "http://hassio/homeassistant" is recommended!

ok I changed my url to:

HASS:
  type: hass
  ha_url: http://192.168.1.2:8123
  ha_key: xxxxxxxx

but it do not works…

WARNING AppDaemon: Excessive time spent in utility loop: 1520.0ms

This do not works… when I enter in my home and alarm system switch to “disarmed” Occusim is not stopped and contnue to turn on and off lights

it only stops it before it is started.
are you sure that switching the alarmsystem to disarmed also sets the input boolean to off?
did you check in HA?

which part of this dont you understand?

WARNING: You are using an non-recommended Home Assistant URL!
WARNING: Setting the "ha_url" option in your AppDaemon config to
WARNING: "http://hassio/homeassistant" is recommended!

so why use something else?

dont worry about that warning if it is just once in a while like that.

If I use in my browser http://hassio/homeassistant… it give me

Not Found

The requested URL /homeassistant was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

thats strange. i guess you need to ask frenck about how that is possible.
its a warning from the addon. not from appdaemon

if use: http://hassio.local:8123

it works fine

then use that.

thats local also i guess.

this wasn’t a good idea… it do not recognize that url…

2018-10-31 22:52:15.614340 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds
2018-10-31 22:52:20.619254 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds
2018-10-31 22:52:25.624958 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds
2018-10-31 22:52:30.629739 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds
2018-10-31 22:52:35.634962 WARNING AppDaemon: HASS: Disconnected from Home Assistant, retrying in 5 seconds

try it in a browser before you try it in appdaemon.

in a browser http://hassio.local:8123 works fine

it ask me for username and password

I generated a token from HA and put it in HASS section

that wont work with appdaemon 3.0.1
appdaemon 3.0.1 needs the api key that you have set inside your hass configuration file.