07-02-2023 10:54 AM
I'm trying to use the script editor to make an automation that is conditional on the light level reading from my Eve Motion sensor.
For device.state.SensorState, the state field must be a field path like "currentSensorStateData.SmokeLevel.rawValue", but there's no auto-completion and no listing of the possible values. I have no idea what to put here and it's not clear how to figure it out.
How can you see the possible sensor state fields for a given device?
The examples look like:
starters:
- type: device.state.SensorState
device: My Device - Room Name
state: currentSensorStateData.SmokeLevel.currentSensorState
is: high
Ref: https://developers.home.google.com/automations/schema/reference/entity/sht_device/sensor_state_state
07-15-2023 08:56 PM
I'm not a coder but I was scanning through the scripted automation examples at https://developers.home.google.com/automations/example-scripts and saw a possible (shot in the dark) solution.
currentSensorStateData.BrightnessLevel.currentSensorState
If that doesn't work, then my next guess is that since Google Home is cloud-based, it may prevent the automation from functioning as you intend because (if I understand correctly) luminance level measurements may not be a cloud-to-cloud supported sensor trait, yet.
Reference: https://developers.home.google.com/cloud-to-cloud/traits/sensorstate
For a definitive answer, I recommend that you contact Google Home technical support.
07-17-2023 10:23 AM
@nathanperkinsdid you find an answer? I too am looking to utilize my Light Sensors but seems they are just useless at the moment
07-20-2023 09:54 PM
Following
08-02-2023 08:28 AM
Specifically for Eve motion sensor V2 I opened a ticket with Eve Home support saying I am unable to access the light sensor for automations using the script editor and they replied saying this is a feature Google must implement?! I would have thaught it would be the other way round but ok then...
08-21-2023 03:25 AM
I have the same problem. With the new script editor, I can finally use the motion data as a starter for my automation. However, even if I can see the device, I cannot use "currentSensorStateData" to read the light level readings. Any idea of when will that be possible?
10-04-2023 06:54 PM
Same issue with the Eve Motion Sensor. I can maybe get away with a time condtion, but the brightness level would be ideal.
By the way, I tried BrightnessLevel.currentSensorState and is not supported
03-27-2024 11:18 AM
lightLevel.currenSensorState seems working, but I couldn't find right state, I tried everything (dark, bright, direct sunlight...), no success... rawValue doesn't work, so no chance to use number of lux (Philips Hue outdoor sensor)
11-07-2023 06:03 PM
Also following, hoping to extract some more sensor state data from Hue motion sensors.
11-14-2023 04:56 AM
Same here with the Eve motion sensor. No clue how to use the brightness data provided from the sensor for automations. Feels kinda useless right now.
11-14-2023 07:08 AM
I found some info on another thread, and this (for hue motion sensors) is working! I
’temperatureAmbient’ is what I was looking for. Now to find humidity and lux…
starters:
- type: device.state.TemperatureControl
state: temperatureAmbient
greaterThan: 25C
device: Garage Motion Sensor - Garage
11-22-2023 02:24 AM
I'm interested in this as well.
No problem in setting up the motion sensor in a script and that is working well.
It would be good to use the light level too in a script. It's strange as I can see the light level in the Google Home app for the sensor, but I don't know what starter type I need to use in the script to use this data in an automation.
11-28-2023 10:22 AM
I've been struggling with this as well, it looks like when you go to set up an automation (not via script) there's only Occupancy setting, so it does sound like either Eve is not correctly advertising the Lux setting, or Google is not correctly receiving it (but it shows up in the google app when you click on device settings, so I'm leaning towards it being a Google problem)
Hoping that a Google dev out there sees this and can take a look at why these devices are not working...
12-07-2023 05:30 AM
Yes I agree. The fact it's in the Google Home App shows the Eve device is sending the data out. It would be good to know how to use this lux data in the script editor.
Hopefully someone in the Google Home team will be able to help...?
12-17-2023 06:38 PM
I see officially at https://www.evehome.com/en-us/eve-motion at the bottom of the page light level is shown as not available for Google home. However, I do agree that I can see it on Google Home device data. I believe now the issue is that Eve has to implement a specific feature for us to use this in automation, and then I guess Google would have to approve it. Hopefully this won't end up being a chicken and egg problem.
02-22-2024 12:04 AM
It's a shame there's been no update on this as being able to use the lux data in the script editor would be really useful.
02-28-2024 11:11 AM
We can see the light level inside the Google Home app but still cannot use the sensor data for automations.
02-28-2024 11:37 AM
As we search for the solution - what is everybody planning to use the light level for?
03-19-2024 08:39 AM
I'd like to auto-adjust my roller-shutters, based on the amount of light that comes from the windows
03-27-2024 11:22 AM
I just gave up and added an aeotec hub with matter.
Automations using both light and motion are working flawlessly and everything runs locally and finally absolutely reliably.
Matter sensors on Google home have been a huge mess since the Fuchsia 16 update on my and my parents nest hubs.
05-05-2024 11:46 AM
Just submitting yet another request to use light level data from Eve Motion sensors in Google Home automations.
Has anyone figured out a way to do this without getting a new hub?
08-31-2024 12:04 PM
I managed to get my Eve Motion sensor working using this code.
metadata:
name: Landing Light Sensor
description: When motion is detected and light level is low, turn the landing light on. Then turn it off after five minutes.
automations:
- starters:
type: device.state.OccupancySensing
device: Sensor - Landing
state: occupancy
is: OCCUPIED
condition:
type: device.state.SensorState
device: Sensor - Landing
state: currentSensorStateData.LightLevel.rawValue
lessThanOrEqualTo: 1
#type: time.between
#after: sunset
#before: sunrise
actions:
type: device.command.OnOff
devices: Landing Light - Landing
on: true
- starters:
type: device.state.OccupancySensing
device: Sensor - Landing
state: occupancy
is: UNOCCUPIED
for: 5min
actions:
type: device.command.OnOff
devices: Landing Light - Landing
on: false
I've left in the comments in the condition, just incase you only want it to work between sunset and sunrise.
09-01-2024 12:52 AM
Nice one.
In your testing have you changed
state: currentSensorStateData.LightLevel.rawValue
lessThanOrEqualTo: 1
To anything other than 1? And do you know what kind of light level it is or just dark?
Going to have a text with this though, thanks for the code.
09-01-2024 12:57 AM
In the Google Home app, if you go in to your sensor, you will see a value for Light level. When the light is on (in the room where the sensor is), the Light level value (for me) was around 22, so I originally set the value to lessThanOrEqualTo: 5 but this was too high for me. I did some experimenting and ended up with 1 but you can use whichever value works best for you.
09-01-2024 01:02 AM
Awesome cheers. I want sure if 1 was the only value it could be but it's good to know it can be customised!
Great find! Looking forward to testing this.