I am currently trying to control a switchable plug from Homematic (HM-LC-Sw1-Pl-DN-R1) via the python_scripts integration:
switchable_plug = data.get("eid_switchable_plug", "")
sp = hass.states.get(switchable_plug)
state = sp.state
if state == "off":
hass.states.set(switchable_plug, "on")
elif state == "on":
logger.info("Switch is on")
else:
logger.info(state)
However, only the state in the frontend changes, but not on the plug itself.
What am I missing here?
Thanks for your help in advance!