Hi all,
I am new to Domoticz, and I have a question:
I currently have a Scene which is activated by a Motion detector, and activates a light at 100% brightness. This works fine, but after sunset I'd like it to have a lower brightness.
My idea was to duplicate the Scene to make a "night version" of the same scene, and use Timers to toggle the "day" and "night" scenes on and off before and after sunset.
However, I am having multiple problems setting this up.
Problem 1:
I cannot recreate the same scene. I am not sure how I did it the first time, but I am having trouble adding the Activation Device. When I press Add Device, it asks me to press a button on a remote I do not have, so I use this trick to add the activation device with the API:
https://github.com/domoticz/domoticz/is ... -764802951
(I also tried "walking into the room" the moment Domoticz asks me to press the button, but it did not work)
I call the API with the "cmnd=On" parameter, but when I look in the Web UI afterwards, the "Code" is "Off" on the line with the activation device. On my "old" scene, this is "On" (I don't dare to try to delete or edit my old scene, because I think I might not me able to recreate it). I think this is the cause that I now see the light dim to 50% (the brightness I have set in the "night" scene) when I leave the room, instead of when I enter it.
Problem 2:
I cannot get the timers to work the way I want. I have added a timer "Active Yes; Type Before Sunrise" to the night scene, and a timer "Active Yes; Type After Sunrise" to the day scene. However both still seem to be active (When I enter the room the light turns to 100% brightness, when I leave it turns to 50% brightness). I also tried adding a "reverse" line to both scenes, "Active No; Type After Sunrise" to the night scene, and a timer "Active No; Type Before Sunrise" to the day scene. But this did not seem to help. Part of my confusion is I don't know whether "Active" means "The Scene is active" or "The Scene will activate when the Activation device triggers" or just "This timer is Active".
I am thinking I am on the wrong track, maybe my goal can be achieved in a totally different way. I hope someone can help me.
Extra info:
- I use version 2022.1
- I use Zigbee2MQTT
- I run Domoticz on a Raspberry Pi
How to make a scene work differently after sunset
Moderator: leecollings
-
- Posts: 4
- Joined: Monday 19 May 2014 12:14
- Target OS: Linux
- Domoticz version: 2024.4
- Contact:
Re: How to make a scene work differently after sunset
The easiest way is to make a DzEvent script which triggers if the motion detector fires. If it is after sunset switch lamp on to x% else switch lamp on to y%
Running Domoticz 2024.4 on Intel NUC5CPYH Ubuntu Docker
Hardware: RfxComm, Zigbee2MQTT - Conbee, P1 interface usb
Hardware: RfxComm, Zigbee2MQTT - Conbee, P1 interface usb
-
- Posts: 2
- Joined: Thursday 04 August 2022 20:04
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: How to make a scene work differently after sunset
Thank you! The Events works much better. I still use the Scene to turn the light off after a few minutes, but I no longer use the Activation Device, but instead a script. This is the script I used:
Code: Select all
return {
on = {
devices = {
'Motion Detector'
}
},
execute = function(domoticz, device)
if (device.active) then
-- check time of the day
if (domoticz.time.isDayTime) then
--activate my scene
domoticz.scenes('Daytime Scene').switchOn()
else
domoticz.scenes('Night Scene').switchOn()
end
end
end
}
Who is online
Users browsing this forum: No registered users and 0 guests