I don’t understand how to incorporate attributes to an entity’s state into my automations. For instance, here is my phone. The “state” is “Office” because I am in my geofenced location for work:
source_type: gps
battery_level: 38
latitude: xxxxx
longitude: -xxxxx
gps_accuracy: 32.00483309472351
attribution: Data provided by Apple iCloud
account_fetch_interval: 5
device_name: iPhone X
device_status: offline
owner_fullname: xxxxxx
battery_status: NotCharging
battery: 38
low_power_mode: false
friendly_name: Steve's Phone
icon: 'mdi:cellphone-iphone'
I am curious how I am able to incorporate some of these attributes into my automations using node-red (I really like the visualization of the automation flows that provides me! Great for someone as inexperienced as me). For instance, how would I go about changing my desk lamp from color to color based on the following:
if battery is over under 20, light is red at 100% brightness
if battery is over 20-98 and is not currently charging, light is green at 20% brightness
if battery is over 20-98 and is currently charging, light does a colorloop at 100% brightness
if battery is 99-100, light is green, at 100% brightness
These automations would also require me giving the light.turn_on service more details (color, brightness, colorloop effect, etc)
Thank you so much in advance. Outstanding product this is.