a week ago - last edited a week ago
Hi,
I'm trying to create an automation to notify when thermostat loose power or get disconnected or not available:
===============
metadata:
name: Roof Thermostat
description: When Thermostat Roof is not available, get a notification
automations:
- starters:
- type: device.state.OperationalState
device: Thermostat Roof - Roof
state: isOperational
is: false
actions:
- type: home.command.Notification
title: Notification
body: Thermostat Roof is not available
===============
Unfortunately, I'm getting error:
===============
[device.state.OperationalState] is an unknown type name. Expected types: [time.schedule, device.state, device.event, device.state.AppSelector, device.state.ArmDisarm, device.state.Brightness, device.state.Channel, device.state.ColorSetting, device.state.Cook, device.state.Dock, device.state.EnergyStorage, device.state.FanSpeed, device.state.Fill, device.state.HumiditySetting, device.state.InputSelector, device.state.LightEffects, device.state.LockUnlock, device.state.MediaState, device.state.MotionDetection, device.state.OccupancySensing, device.state.Online, device.state.OnOff, device.state.OpenClose, device.state.Record, device.state.Rotation, device.state.RunCycle, device.state.SensorState, device.state.StartStop, device.state.TemperatureControl, device.state.TemperatureSetting, device.state.Timer, device.state.Volume, device.event.DoorbellPress, device.event.MotionDetection, device.event.PersonDetection, device.event.PackageDelivered, device.event.AnimalOtherDetection, device.event.FaceFamiliarDetection, device.event.FaceUnfamiliarDetection, device.event.MovingVehicleDetection, device.event.Sound, device.event.PersonTalking, assistant.event.OkGoogle, home.state.HomePresence, etc].
===============
Please advise and help
Answered! Go to the Recommended Answer.
Wednesday - last edited Wednesday
Thanks for sharing.
Based on the error message, the issue is that device.state.OperationalState
is not a valid device state type for automations. The test is explicitly telling you what types it does recognize, such as device.state.Online
.
To fix this, you should change the trigger type in your automation to use a supported state that indicates the device's availability.
Try below script and let me know if it worked for you:
metadata:
name: Roof Thermostat
description: When Thermostat Roof is not available, get a notification
automations:
starters:
type: device.state.Online
device: Thermostat Roof - Roof
state: isOnline
is: false
actions:
type: home.command.Notification
title: Notification
body: Thermostat Roof is not available
Wednesday - last edited Wednesday
Thanks for sharing.
Based on the error message, the issue is that device.state.OperationalState
is not a valid device state type for automations. The test is explicitly telling you what types it does recognize, such as device.state.Online
.
To fix this, you should change the trigger type in your automation to use a supported state that indicates the device's availability.
Try below script and let me know if it worked for you:
metadata:
name: Roof Thermostat
description: When Thermostat Roof is not available, get a notification
automations:
starters:
type: device.state.Online
device: Thermostat Roof - Roof
state: isOnline
is: false
actions:
type: home.command.Notification
title: Notification
body: Thermostat Roof is not available
Thursday - last edited Thursday
Thanks for your help and support dear
It's accepted and correct now
Just one edit:
Instead of: state:
isOnline
Changed to: state:
Online
Since it gave me error with the first one
Your time and efforts are highly appreciated
Wish you a nice day
Saturday