Cool Heat Changeover - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: Cool Heat Changeover (/showthread.php?tid=4123) |
Cool Heat Changeover - KoBra - 30.06.2022 Has anyone already built a script before that can act as a comparitor to see if multiple zones are on cooling, heating or off and to get an output of the mode where the most units are in? If not i have to start making something myself :-) RE: Cool Heat Changeover - admin - 30.06.2022 Assign a common tag to all zone status objects. Map an event script to this tag. It will write true when more than half of tagged objects are true, false otherwise. Make sure that the status output object is not mapped to the same tag. Code: function tag_status(tag) RE: Cool Heat Changeover - KoBra - 04.07.2022 ok but what if i have 6 units and 1 is on in cool and 2 are on in heat? than i need heat output. RE: Cool Heat Changeover - admin - 04.07.2022 Do you mean that there are two objects - heat/cool and on/off status? In this case two tags are needed - central_onoff for on/off status objects and central_state for heat/cool status. Objects must be assigned in a way that they follow the same group address order for both objects. For example 1/1/1 and 1/2/1 - device A, 1/1/2 and 1/2/2 - device B and so on. Gaps between group addresses is ok. Code: function tag_status(onoff_tag, state_tag) |