Solved: Homatic HM-LC-Sw1-Pl-DN-R1 Set on for X Minute

In FHEM it is possible to tell the radio-controlled socket to switch on but only for x minutes. You can send this command again and again to extend the time. If FHEM crashes, the socket will still switch off after the specified time.

Is it possible in HA to tell the socket Homatic HM-LC-Sw1-Pl-DN-R1 the maximum time it can run?

This is a safety function to ensure that the cooker hood switches off after HA fails.

Yes, with the new integration this is possible. Don’t know from the top of my head how exactly, but it’s possible to send the ON_TIME when turning on a device.

Thanks for your tip. I had also found something about it on Google at the time and have finally implemented it.

If I have understood it correctly, this is still the old way of writing (legacy method) or? (Difference between "sensor platform Template" and "Template sensor ")

Description:
When the cooker bonnet is switched on, a timer of 60 seconds is set.
If the switch-on command is therefore not sent again, the
Homatic wireless switching actuator 1-fold intermediate plug “HM-LC-Sw1-Pl-DN-R1” switches off automatically.

Edit configuration.yaml

# Beim Einschalten der Dunstabzugshaube wird ein Timer vom 60 Sekunden mitgegeben.
# Wird der Einschaltbefehl also nicht erneut gesendet, schaltet der 
# Homatic Funk-Schaltaktor 1-fach Zwischensteck "HM-LC-Sw1-Pl-DN-R1" automatisch ab.
switch:
  - platform: template
    switches:
      dunstabzugshaube_timer:
        friendly_name: EG - Küche - Dunstabzugshaube - Steckdose (Template Timer 1 Minute)
        unique_id: template_dunstabzugshaube_timer
        value_template: "{{ is_state('switch.hm_lc_sw1_pl_dn_r1_oeq0073242', 'on') }}"
        turn_on:
          service: homematicip_local.put_paramset
          data:
            device_id: e1a913cb3bce8922ef8afc9c0a54c264
            channel: 1
            paramset_key: VALUES
            paramset:
              ON_TIME: "60"
              STATE: true
        turn_off:
          service: switch.turn_off
          target:
            entity_id: switch.hm_lc_sw1_pl_dn_r1_oeq0073242

Note: To find the ID, you can create an automation by inserting the switch as the ON action and switching to YAML mode. Then you can find the device ID.

… or you use the included services light_set_on_time or light_set_on_time

@SukramJ

I think switch_set_on_time is good

I have configured it once. But I won’t be able to test it on site until the end of the week. So the service also starts the timer on the Homatic device and is independent of HA?

If so, thanks for the tip. I like that even more.


For all those who want to understand it. You can select Service as an action in the automation.

Works very well. I have just restarted HA from the road and the Homatic socket is still switched off after the time has elapsed. So I think the timer of the socket is being used. Thank you

Solutions:

There are two solutions:

From @danielperna84: Solved: Homatic HM-LC-Sw1-Pl-DN-R1 Set on for X Minute - #2 by danielperna84
Result: Solved: Homatic HM-LC-Sw1-Pl-DN-R1 Set on for X Minute - #3 by LHBL2003

And

From @SukramJ: Solved: Homatic HM-LC-Sw1-Pl-DN-R1 Set on for X Minute - #4 by SukramJ
Result: Solved: Homatic HM-LC-Sw1-Pl-DN-R1 Set on for X Minute - #5 by LHBL2003

Thank you for your help.

Final Solution

The basic idea / The idea of @danielperna84 is better (put_paramset). Because it is not possible to extend the variant (switch_set_on_time).

My plan: Extend the switch-on timer by 5 minutes every 2.5 minutes.

put_paramset: Time is extended. The socket never switches off.
switch_set_on_time: The command is triggered every 2.5 minutes and the socket is switched on. However, the socket still switches off after 5 minutes.

Therefore, the put_paramset version is the best for me:

service: homematicip_local.put_paramset
data:
  device_id: e1a913cb3bce8922ef8afc9c0a54c264
  channel: 1
  paramset_key: VALUES
  paramset:
    ON_TIME: "300"
    STATE: true
alias: >-
  Schaltet die Steckdose ein, wobei der Steckdose eine Dauer von X Sekunden
  gemeldet wird, damit die Steckdose immer abschaltet, wenn HomeAssistant
  gestört ist.