Page 1 of 1

Smoke detector reset

Posted: Wednesday 05 May 2021 14:58
by sieth
Hello community,

I have a problem with resetting my smoke detectors (433Mhz)

They switch on perfectly, I can reset the detectors and they seem to reset the devices.
They turn "Off" but when I run a script (LUA) to check if they are "Off" the script runs as if they are turned on.

Restarting Domoticz does the trick. Then the script sees the detectors in the "Off" status.

Do I miss something here? Is this a bug?

Thanks in advance!
Keith

Re: Smoke detector reset

Posted: Wednesday 05 May 2021 16:17
by waaren
sieth wrote: Wednesday 05 May 2021 14:58 I have a problem with resetting my smoke detectors (433Mhz)
They turn "Off" but when I run a script (LUA) to check if they are "Off" the script runs as if they are turned on.
Can you try after a reset of your smoke detector from a Lua / dzVents script using

Code: Select all

http://<domoticz IP: domoticz port>/json.htm?type=command&param=resetsecuritystatus&idx=<IDX>&switchcmd=Normal
Maybe a next script will see the state of the detector as 'Off' or as 'normal' after this?

Re: Smoke detector reset

Posted: Wednesday 05 May 2021 16:43
by sieth
Waaren,

thank you for replying.

I tried all the json commands found in the wiki.
It did nothing, the script saw the detector "On".

Restarting Domoticz is currently my only solution. :geek:

Greeting's,
Keith

Re: Smoke detector reset

Posted: Wednesday 05 May 2021 16:53
by waaren
sieth wrote: Wednesday 05 May 2021 16:43 I tried all the json commands found in the wiki.
It did nothing, the script saw the detector "On".
A copy of the device states is send to the script before execution and the values in that copy will not change during execution of the script.
Please share the script so we can help troubleshooting.

Re: Smoke detector reset

Posted: Wednesday 05 May 2021 18:47
by sieth
Very simple script.

When smoke detected, lights should turn on.
When detector has been reset, the lights are turned off manually.

Code: Select all

commandArray = {}

if otherdevices['Detector1']=="On" or otherdevices['Detector2']=="On" 
then 

    if otherdevices['Light1']=="Off" then
    commandArray[#commandArray+1]={['Light1']="On"}
    end
    
    if otherdevices['Light2']=="Off" then
    commandArray[#commandArray+1]={['Light2']="On"}
    end

print("Smoke")
end
return commandArray

Re: Smoke detector reset

Posted: Thursday 06 May 2021 1:46
by waaren
sieth wrote: Wednesday 05 May 2021 18:47 When smoke detected, lights should turn on.
When detector has been reset, the lights are turned off manually.

Below test Lua will act on active smoke detectors and will reset the active ones after a set amount of seconds.

Code: Select all

commandArray = {}

local detectors = { 'smoke' , 'testSmoke' } -- Name of your detectors
local dzPort = 8080 -- domoticz port
local resetTime = 30 -- in seconds

for idx, detector in ipairs(detectors) do
    if otherdevices[detector] == "On" then

        local resetURL = 'http://127.0.0.1:' .. dzPort ..'/json.htm?type=command&param=resetsecuritystatus&idx=' .. otherdevices_idx[detector] .. '&switchcmd=Normal'
        -- requires Local Networks (no username/password): to be set to 127.0.0.*;::1

        commandArray[#commandArray + 1] = { ['Alarm licht'] = "On" }
        commandArray[#commandArray + 1] = { OpenURL = resetURL .. ' AFTER ' .. ( resetTime + idx )  }
        commandArray[#commandArray + 1] = { [detector] = 'Off AFTER ' .. ( resetTime + 2 + idx ) }

        print('Smoke detected. Reset ' .. detector .. ' in ' .. (resetTime + 2 + idx ) .. ' seconds')
    else
        print(detector .. ' not active (' .. otherdevices[detector] .. ')')

    end
end

return commandArray

Re: Smoke detector reset

Posted: Thursday 06 May 2021 11:19
by sieth
Thank you for helping me.

I tried your method but this was my log:
Spoiler: show
2021-05-06 11:17:12.548 Status: LUA: Smoke detected. Reset Rookmelder UPS in 33 seconds
2021-05-06 11:17:12.548 Status: LUA: Rookmelder Garage not active (Off)
2021-05-06 11:17:12.548 Status: EventSystem: Fetching URL http://127.0.0.1:8084/json.htm?type=com ... cmd=Normal after 31.0 seconds...
2021-05-06 11:17:12.562 Status: LUA: Smoke detected. Reset Rookmelder UPS in 33 seconds
2021-05-06 11:17:12.562 Status: LUA: Rookmelder Garage not active (Off)
2021-05-06 11:17:12.562 Status: EventSystem: Fetching URL http://127.0.0.1:8084/json.htm?type=com ... cmd=Normal after 31.0 seconds...
2021-05-06 11:17:13.873 Status: LUA: Smoke detected. Reset Rookmelder UPS in 33 seconds
2021-05-06 11:17:13.873 Status: LUA: Rookmelder Garage not active (Off)
2021-05-06 11:17:13.873 Status: EventSystem: Fetching URL http://127.0.0.1:8084/json.htm?type=com ... cmd=Normal after 31.0 seconds...
2021-05-06 11:17:13.887 Status: LUA: Smoke detected. Reset Rookmelder UPS in 33 seconds
2021-05-06 11:17:13.887 Status: LUA: Rookmelder Garage not active (Off)
2021-05-06 11:17:13.887 Status: EventSystem: Fetching URL http://127.0.0.1:8084/json.htm?type=com ... cmd=Normal after 31.0 seconds...
2021-05-06 11:17:14.053 Status: LUA: Smoke detected. Reset Rookmelder UPS in 33 seconds
2021-05-06 11:17:14.053 Status: LUA: Rookmelder Garage not active (Off)
2021-05-06 11:17:14.053 Status: EventSystem: Fetching URL http://127.0.0.1:8084/json.htm?type=com ... cmd=Normal after 31.0 seconds...
It kept going on forever. No reset was given.

Strange.

I've did a manual reset of the smoke detector but no change there...

:?: :geek:

Re: Smoke detector reset

Posted: Thursday 06 May 2021 11:28
by waaren
sieth wrote: Thursday 06 May 2021 11:19 I tried your method but this was my log:
It kept going on forever. No reset was given.
I double checked this on my installation (2021.1 build 13249) and the script works as expected.
What is the last seen time on the smoke detector before, during and after an execution cycle? (you may have to [ctrl] r to refresh the switch tab page)

Did you check this?
-- requires Local Networks (no username/password): to be set to 127.0.0.*;::1

Re: Smoke detector reset

Posted: Thursday 06 May 2021 13:31
by sieth
Did you check this?
-- requires Local Networks (no username/password): to be set to 127.0.0.*;::1
Yes this is always configured on my setup.
I use domoticz for years but this strange issue I cannot explain.

When activating the smoke detector I checked the status of the device with json just to be sure:
http://ip:port/json.htm?type=devices&rid=idx --> "Status" : "On"

When deactivating/resetting
http://ip:port/json.htm?type=devices&rid=idx --> "Status" : "Off"

Everything seems turned "Off", only the scripted says it's "On"

Tried everything...
Very strange

Re: Smoke detector reset

Posted: Thursday 06 May 2021 13:45
by waaren
sieth wrote: Thursday 06 May 2021 13:31 Tried everything...
Very strange
Can you show the complete result of

Code: Select all

http://ip:port/json.htm?type=devices&rid=idx
maybe I see something that is different from my setup and could explain why it does not work for you?

Re: Smoke detector reset

Posted: Thursday 06 May 2021 18:00
by sieth
Ok, this are the outputs:

Smokedetector = On
Spoiler: show

Code: Select all

{
	"ActTime" : 1620316718,
	"AstrTwilightEnd" : "23:48",
	"AstrTwilightStart" : "03:33",
	"CivTwilightEnd" : "21:52",
	"CivTwilightStart" : "05:29",
	"DayLength" : "15:05",
	"NautTwilightEnd" : "22:43",
	"NautTwilightStart" : "04:38",
	"ServerTime" : "2021-05-06 17:58:38",
	"SunAtSouth" : "13:40",
	"Sunrise" : "06:08",
	"Sunset" : "21:13",
	"app_version" : "2021.1 (build 13226)",
	"result" : 
	[
		{
			"AddjMulti" : 1.0,
			"AddjMulti2" : 1.0,
			"AddjValue" : 0.0,
			"AddjValue2" : 0.0,
			"BatteryLevel" : 255,
			"CustomImage" : 0,
			"Data" : "On",
			"Description" : "",
			"DimmerType" : "none",
			"Favorite" : 0,
			"HardwareDisabled" : false,
			"HardwareID" : 9,
			"HardwareName" : "433MHz",
			"HardwareType" : "RFXCOM - RFXtrx433 USB 433.92MHz Transceiver",
			"HardwareTypeVal" : 1,
			"HaveDimmer" : false,
			"HaveGroupCmd" : false,
			"HaveTimeout" : false,
			"ID" : "ED120B",
			"Image" : "Light",
			"IsSubDevice" : false,
			"LastUpdate" : "2021-05-06 13:31:49",
			"Level" : 0,
			"LevelInt" : 377,
			"MaxDimLevel" : 0,
			"Name" : "Rookmelder UPS",
			"Notifications" : "true",
			"PlanID" : "10",
			"PlanIDs" : 
			[
				10
			],
			"Protected" : false,
			"ShowNotifications" : true,
			"SignalLevel" : "-",
			"Status" : "On",
			"StrParam1" : "",
			"StrParam2" : "",
			"SubType" : "PT2262",
			"SwitchType" : "Smoke Detector",
			"SwitchTypeVal" : 5,
			"Timers" : "false",
			"Type" : "Lighting 4",
			"TypeImg" : "smoke",
			"Unit" : 0,
			"Used" : 1,
			"UsedByCamera" : false,
			"XOffset" : "0",
			"YOffset" : "0",
			"idx" : "186"
		}
	],
	"status" : "OK",
	"title" : "Devices"
}
Smoke detector = off
Spoiler: show

Code: Select all

{
	"ActTime" : 1620316810,
	"AstrTwilightEnd" : "23:48",
	"AstrTwilightStart" : "03:33",
	"CivTwilightEnd" : "21:52",
	"CivTwilightStart" : "05:29",
	"DayLength" : "15:05",
	"NautTwilightEnd" : "22:43",
	"NautTwilightStart" : "04:38",
	"ServerTime" : "2021-05-06 18:00:10",
	"SunAtSouth" : "13:40",
	"Sunrise" : "06:08",
	"Sunset" : "21:13",
	"app_version" : "2021.1 (build 13226)",
	"result" : 
	[
		{
			"AddjMulti" : 1.0,
			"AddjMulti2" : 1.0,
			"AddjValue" : 0.0,
			"AddjValue2" : 0.0,
			"BatteryLevel" : 255,
			"CustomImage" : 0,
			"Data" : "Off",
			"Description" : "",
			"DimmerType" : "none",
			"Favorite" : 0,
			"HardwareDisabled" : false,
			"HardwareID" : 9,
			"HardwareName" : "433MHz",
			"HardwareType" : "RFXCOM - RFXtrx433 USB 433.92MHz Transceiver",
			"HardwareTypeVal" : 1,
			"HaveDimmer" : false,
			"HaveGroupCmd" : false,
			"HaveTimeout" : false,
			"ID" : "ED120B",
			"Image" : "Light",
			"IsSubDevice" : false,
			"LastUpdate" : "2021-05-06 13:31:49",
			"Level" : 0,
			"LevelInt" : 377,
			"MaxDimLevel" : 0,
			"Name" : "Rookmelder UPS",
			"Notifications" : "true",
			"PlanID" : "10",
			"PlanIDs" : 
			[
				10
			],
			"Protected" : false,
			"ShowNotifications" : true,
			"SignalLevel" : "-",
			"Status" : "Off",
			"StrParam1" : "",
			"StrParam2" : "",
			"SubType" : "PT2262",
			"SwitchType" : "Smoke Detector",
			"SwitchTypeVal" : 5,
			"Timers" : "false",
			"Type" : "Lighting 4",
			"TypeImg" : "smoke",
			"Unit" : 0,
			"Used" : 1,
			"UsedByCamera" : false,
			"XOffset" : "0",
			"YOffset" : "0",
			"idx" : "186"
		}
	],
	"status" : "OK",
	"title" : "Devices"
}

Re: Smoke detector reset

Posted: Thursday 06 May 2021 21:34
by waaren
sieth wrote: Thursday 06 May 2021 18:00 Ok, this are the outputs:
Checked against mine but do not see any differences that could explain different behavior.

Re: Smoke detector reset

Posted: Friday 07 May 2021 10:48
by sieth
Let's blame it on the 433MHz smoke detectors. :lol:
I'll just restart domoticz when they were activated.
No problem.

Thanks for helping me!

Keith

Re: Smoke detector reset

Posted: Wednesday 22 September 2021 15:05
by manjh
sieth wrote: Friday 07 May 2021 10:48 Let's blame it on the 433MHz smoke detectors. :lol:
I'll just restart domoticz when they were activated.
No problem.

Thanks for helping me!

Keith
Which brand are the detectors?
I am considering buying four KAKU detectors, but before I do that want to make sure they work properly with Domoticz!

Re: Smoke detector reset

Posted: Wednesday 22 September 2021 15:22
by sieth
They are from Aliexpress

https://a.aliexpress.com/_mrwQPxD

:) greetings

Re: Smoke detector reset

Posted: Saturday 25 September 2021 9:32
by manjh
sieth wrote: Wednesday 22 September 2021 15:22 They are from Aliexpress

https://a.aliexpress.com/_mrwQPxD

:) greetings
Thanks. I looked at the description, and it looks like a good deal. I read that you get four detectors for 23 or 24 Euro?

Re: Smoke detector reset

Posted: Saturday 25 September 2021 10:53
by waltervl
manjh wrote: Saturday 25 September 2021 9:32
sieth wrote: Wednesday 22 September 2021 15:22 They are from Aliexpress

https://a.aliexpress.com/_mrwQPxD

:) greetings
Thanks. I looked at the description, and it looks like a good deal. I read that you get four detectors for 23 or 24 Euro?
Watch out for extra taxes and transport fees when buying something from outside Europe! New rules being implemented from 1st of July.

Re: Smoke detector reset

Posted: Monday 27 September 2021 22:06
by manjh
Yes, I know. But the product description at AliExpress now states "VAT included", so I assume this makes it safe to order without additional cost, right?

Re: Smoke detector reset

Posted: Monday 27 September 2021 22:52
by waltervl
I did not try it yet. According this article (in dutch) it should be possible: https://nos.nl/l/2384698

Re: Smoke detector reset

Posted: Tuesday 28 September 2021 3:39
by sieth
manjh wrote: Monday 27 September 2021 22:06 Yes, I know. But the product description at AliExpress now states "VAT included", so I assume this makes it safe to order without additional cost, right?
Indeed, works perfectly.
No additional costs.

For me the new rules are better.
You can now buy to 150€ without hidden costs.
Ordered several things and they all arrived.