Fan status
Domoticz

Fan status

Show the actual status of a fan
A flow by joro75

Download flow Download assets

Flow Details

🏁 Purpose

Show the actual status of a fan (which is a present as a switch in Domoticz) on the AWTRIX3 clock, also showing a stopped fan or a rotating fan as the icon.

πŸ”„ Activation and device selection

This Domoticz dzVents script is marked as active by active = true.

The name of the Domoticz device that should be monitored should be selected in the devices = { 'Bathroom fan' } section.

Also download the icons '7426' and '20121' on your AWTRIX3 clock. Those icons are also attached as asset on this flow.

βš™οΈ Script Logic

Every time when the status of the selected device changes, the state is determined and the rotating or not rotating icon is selected, which is then directly updated as a custom app (with the name 'Bathroom_fan' on the AWTRIX3 unit).

πŸ“ Logging

  • Logs are generated with the marker "AWTRIX_Bathroom_Fan" to identify entries related to this script.
  • The logging level is set to domoticz.LOG_INFO, ensuring that informational messages are captured.

🎚️ Flow adjustment

Any generic switch in Domoticz can be monitored on the same way. Just be sure to:

  1. Include the correct name of the Domoticz device in the devices = { .... } section
  2. Update the name of the logging = { marker = "....." } line
  3. Download a suitable 'on'-icon and 'off'-icon on the AWTRIX3 clock
  4. Use the corresponding icon numbers in the dzVents script
  5. If multiple dzVents scripts for the AWTRIX3 are present, update the appData = { appname = "...." } name, to have an individual app page for every script

βœ‚οΈ Required plugins and more information:

return { -- The script is active active = true, -- Trigger section: when the device changes on = { devices = { 'Bathroom fan' -- Replace with the name of the device } }, -- Custom logging level for this script logging = { level = domoticz.LOG_INFO, marker = "AWTRIX_Bathroom_Fan" }, -- Event execution when the device changes execute = function(domoticz, device) local icon = 7426 -- Rotating fan if device.state == 'Off' then icon = 20121 -- Stopped fan end appData = { appname = "Bathroom_fan", text = device.state, icon = icon } local appJSON = domoticz.utils.toJSON(appData) domoticz.log("Sending fan status to AWTRIX3: " .. appJSON, domoticz.LOG_INFO) local appDevice = domoticz.devices('AWTRIX3 - Send Custom App') if appDevice then appDevice.setDescription(appJSON) appDevice.switchOn().afterSec(2) else domoticz.log("'AWTRIX3 - Send Custom App' device not found", domoticz.LOG_ERROR) end end }
/flows/pnKe573P5ZjM/20121.jpg
/flows/pnKe573P5ZjM/7426.gif
-- Flow first published on January 6, 2025, last updated on January 6, 2025 at 21:01.