Toggle Power On PC
Use with Domoticz
The purpose of this script is to ensure that the AWTRIX3 device is powered in sync with the PC device, turning the AWTRIX3 device on when the PC is turned on and off when the PC is turned off. This can be useful for managing power usage or ensuring certai
- Topic
- Smarthome
- Includes
- Flow
Runs on
- Does not run on 32×8 (TC001 & DIY) Made for AWTRIX 3.
- Does not run on 52×16 (TC002) Made for AWTRIX 3.
- Runs on 32×8 with AWTRIX 3 (TC001 & DIY)
Flow description
-
🔄 Activation and Scope:
- The script is active, as indicated by
active = true. - It listens for state changes specifically from the device labeled 'PC'.
- The script is active, as indicated by
-
📝 Logging:
- The script logs information messages with a marker labeled "AWTRIX3_APP". This helps in identifying logs related to this specific script.
- The level of logging is set to
domoticz.LOG_INFO, meaning informational messages will be recorded.
-
⚙️ Execution Logic:
-
The
executefunction is triggered whenever there is a change in the state of the 'PC' device. -
When the
PCdevice state changes to 'On':- The script checks if the 'AWTRIX3 - Power' device is not already 'On'.
- If it isn't ('On'), the script turns it 'On' 🟢 and logs an informational message stating that 'AWTRIX3 - Power' was turned on because 'PC' is on.
-
When the
PCdevice state changes to 'Off':- The script checks if the 'AWTRIX3 - Power' device is not already 'Off'.
- If it isn't ('Off'), the script turns it 'Off' 🔴 and logs an informational message stating that 'AWTRIX3 - Power' was turned off because 'PC' is off.
-
🔌 Purpose: The purpose of this script is to ensure that the AWTRIX3 device is powered in sync with the PC device, turning the AWTRIX3 device on when the PC is turned on and off when the PC is turned off. This can be useful for managing power usage or ensuring certain devices are only active when necessary.
More information:
Domoticz:
www.domoticz.com
Domoticz AWTRIX3 Plugin:
https://github.com/galadril/Domoticz-AWTRIX3-Plugin
Sign in to view and copy the code of this flow.
Discussion 0
Ask a question, suggest a change or share how you use it.
No comments yet. Start the conversation.
Have an idea?
Sign in to ask questions and join the conversation.