Need help with some rules

Hi there.
I’m new to community and relatively new to HA. Was using OpenHab for couple years now, but wanted to try something else, so here I am.

So lets cut to the chase.
I need someone to help with two rules that I can not figure out for myself.

The first is for my heating system. I have two switches that each control a relay and I need to make three state switches from them.
The idea is if one relay is on then heating is on “Comfort” mode, if other relay is on then “Eco” mode and if both them are off, then heating is on “Auto” mode. The hardware works and I can control Heating system with two switches, but that is just not convinient.
I would like to combine thouse in one switch.
As I could not find out how to do that I made “input_select” entity with thouse 3 selections that is working. But I can not get the imput select to control my automations

So, here is my input_select
name: Apkure
- Eco
- Auto
- Comfort
initial: Auto
icon: mdi:nest-thermostat

And it seams to work fine.
The problem is wit my automation

  - alias: 'Apkures temperatūra_Eco'
      platform: state
      entity_id: input_select.apkures_temp
      to: 'Eco'
      - service: switch.turn_on
        entity_id: switch.katls_2_1
      - service: switch.turn_off
        entity_id: switch.katls_2_2

  - alias: 'Apkures temperatūra_Auto'
      platform: state
      entity_id: input_select.apkures_temp
      to: 'Auto'
      service: switch.turn_off
        - switch.katls_2_1
        - switch.katls_2_2

  - alias: 'Apkures temperatūra_comfort'
      platform: state
      entity_id: input_select.apkures_temp
      to: 'Comfort'
      - service: switch.turn_on
        entity_id: switch.katls_2_2
      - service: switch.turn_off
        entity_id: switch.katls_2_1

I got no errors, but input select does not change switches, hope that someone sees the problem.

So the next should be easy but I can not find any example of this.
I got a light for my unoccupied loft (I hope that this is not a wrong word) and switch for it is next to one for my corridor. Wery often when friends come over they turn on wrong light and I only realize it in next day because the only way to see this is from UI or outside windows.
With openhab, I had a simple rule that notifies me if this light was on for one hour so I can turn it off if it was turned on by accident or let it stay if I was doing something there. Sadly I could not find any example of similar rule please let me know where I can find an example for this.
Thanks and sorry for my bad English and that Im not abble to get formating to work.

I copied your exact config into my test system, and it worked perfectly.
Perhaps the problem lies with your switch definition.
Do the switches work by themselves?

For your second question, see the “complex alert criteria” section of this page:

1 Like

Hi @treno and thanks for your reply, sorry for my late response, was out of town for the weakend.

  1. I will check again when I got home after work, but It worked last time I checked, it is summer now so I have not use them for some time now. The interesting thing is that switches do not change in UI when I change input select they both stay off, not like in your picture that I would like them to do.
    I will look more in this.

  2. Thanks for guiding me to Alert component, somehow I completly missed it. Seems like it is just what I need.

Thanks for your input again. Yesterday I tested things out and found that Rules work as expected only I do not get feedback for my switches, that’s why they do not change in UI, sorry for not testing my setup before posting a question.
And the second problem is fixed by alert component, works as expected.