So, basically I am just a beginner with hass.io and trying to implement my first few automations in HA.
I have an Android Phone connected as IP camera to HA with Motion sensor activated. Motion sensor makes aware of the motion with a state value of a random number (1 defines no motion and a number usually is generated in the state when motion is detected which can be anything <1000, as I have noticed).
Now, I am trying ro make a notification service which activates when motion is registered in the camera (above 250) and the condition of me not being home (I have three zones configured - Home, Work, School). This trigger should say some message through my google home speaker and push a html5 notification to me.
The current automation looks like this -
- id: #randomid
alias: Motion Detection Notification
trigger:
- entity_id: sensor.room_camera_motion
from: '200'
platform: state
to: '1000'
condition:
- condition: zone
entity_id: device_tracker.#mygoogle_maps_id
zone: zone.school
- condition: zone
entity_id: device_tracker.#mygoogle_maps_id
zone: zone.work
- condition: state
entity_id: device_tracker.#mygoogle_maps_id
state: not_home
action:
- service: tts.google_say
entity_id: media_player.google_home
data:
message: 'You should not enter without permission when xxxxx is not home. Notifying xxxxx that you came'
- service: notify.chromehtml5
data:
message: Someone entered the room when you were not home.
While this was my first script, I am not sure how to make the trigger work. So, the current script wants me to mention a ‘from’ value and ‘to’ value of state. But this isn’t what I can do because this can be any random number, for both from and to.
Can anyone help me with this how to specify trigger when state goes above 250? Also, if there’s an easier way to specify when I am just not_home?
thanks