Quick and dirty description:
In domoticz create dummy switch for “phone charging” and lookup the idx.
In iOS app shortcuts create an personal automation for when cable connects. In the automation create an action to get URL headers. Give url as: http://IP:PORT/json.htm?type=command¶m=switchlight&idx=IDX&switchcmd=On
(replace CAPS to yours).
Uncheck “Ask before tuning”
And run and help first time and give permissions to uppopping dialogs. After this it can run automaticly.
Repeat iOS process for “cable disconnects” and use “Off” in end of url.
With an additional dummy switch and a blockly event you could filter if charging starts after your avarage bedtime. (To filter out extra charge moments at daytime).
Best to use internal ip adress to only start domoticz automation based on dummy switches when your at home. (So no automation happens when away).
Let me know what you think of it.
