Help With Triggers

Good Morning All,

I’ve recently moved over to Home Assistant and am quite impressed with it. Unfortunately my home automation gear is rather piece meal, as each item was bought to solve an issue, rather than part of a cohesive plan. That said, most things are working quite well, but I’m struggling with three items and was hoping for some assistance (either in crafting our troubleshooting the automation). As a likely relevant point, I have HomeAssistant install on a separate VLAN than my devices.

The first is that I’d like a series of events to fire when my Reading Light is turned off (it’s plugged into a Lutron Lamp Dimmer). When ran manually everything works, but it doesn’t seem to pick up the state of the lamp and therefore doesn’t fire when it’s needed.

The second is I’m struggling for Home Assistant to pick up the state (“eco”) of my Nest thermostat and fire actions based on that. Again, works fine manually, but doesn’t auto pick it up.

The last thing is I’m using the default weather app / plugin, and would like to leverage it to turn on my outside lights when the weather changes to rainy/snowy, and turn off the lights again when it turns sunny or clear. Any thoughts on how to do this?

Thanks in advance for any help / guidance that you can provide. I’m looking forward to going down the rabbit hole that HA provides :slight_smile:

I suspect your triggers are wrong on the first two. Double check using the the Developers Tools that the value you are looking for on the lamp when off for example is at the value you are testing for. Running the automation manually ignores the triggers.

For the weather ones, the simple way is to use a trigger on the weather changes and then use a Choose to set the action for each set of weather.

If you are still struggling it would help if you can post what you are currently doing and the values from the developer tools

I suspect that maybe I’m not reading the developers tools correctly, but here is the yaml from the thermostat →

hvac_modes:
  - heat_cool
  - 'off'
  - cool
  - heat
  - fan_only
min_temp: 7
max_temp: 35
fan_modes:
  - 'on'
  - 'off'
preset_modes:
  - none
  - eco
current_temperature: 21.2
temperature: null
target_temp_high: 23
target_temp_low: 21.5
fan_mode: 'off'
hvac_action: 'off'
preset_mode: none
friendly_name: Thermostat
supported_features: 27

And here it is from the light →

supported_color_modes:
  - brightness
device_id: '11'
zone_id: '6'
friendly_name: Living Room_Reading Light
supported_features: 33

And here is the trigger for the thermostat (though I’ve been using the GUI) →

- id: '1632269677424'
  alias: Away - Day
  description: ''
  trigger:
  - platform: state
    entity_id: climate.thermostat
    to: eco
  condition:
  - condition: sun
    before: sunset
    after: sunrise

And the relevant portion for the light turning off →

- id: '1632251751208'
  alias: Bed
  description: ''
  trigger:
  - platform: state
    entity_id: light.living_room_reading_light
    from: 'on'
    to: 'off'
  condition:
  - condition: sun
    before: sunrise
    after: sunset

I appreciate you taking the time to assist me, thank you.

Classic mistake : it can’t be before sunset and after sunrise at the same time !

condition:
    condition: or 
    conditions:
      - condition: sun
        before: sunset
      - condition: sun
        after: sunrise

ugh, facepalm. Thanks for that, we’ll see how things go this evening.

~Spritz

The climate trigger probably needs to be:

trigger:
  - platform: state
    entity_id: climate.thermostat
    attribute: preset_mode
    to: eco

It’s not the state that changes to eco, but the attribute preset_mode.

Thank you for all your help, it’s really appreciated. Your suggestions resolved one of the issues.

It appears that the issue lies with the Nest API not correctly reporting that it is in eco mode when it’s triggered by being “away”. In fact, nothing updates in HA when the Nest Thermostat is in away mode (not the temp setting, etc). So to utilize the HA presence sensing, I’ll need to wait for further updates I suppose. This leads to my question of what do people use for presence sensing besides their cell phones?

Finally, for the weather, is it possible to see what variables it supports (sunny, rainy, etc)?

Thanks again for all your help!

~Spritz