I have a cat litterrobot (see attachment) and I want to add a sensor to it which gives Domotics a signal that it is used.
After a cat has used the catlitter robot, the robot cleans itself by turning round..
So, I have made a simple sensor with an Arduino Nano, and NRF24LC01 with adapter and a SW-420 Vibration Tilt Sensor Module (see attachments).
In Domoticz I see the sensor, and I see when it's active or not active. So far so good.
1) first problem: the new Domoticz sensor is visable as SWITCH and can be enabled and disabled: but it must be an INPUT SENSOR ONLY, not a switch/.
=> can this be changed ??
2) second issue (SCRIPT)
I want to have a counter: this counter must be displayed on the Domoticz Dashboard and after (for example) 7 cleanings, the system must send a warning 'EMPTY LITTERBOX PLEASE". After cleaning, the counter must be reset to zero again.
So, I have added an uservariable 'catlitterbox' : integer and initial value 0.
But I have no idea how I must make the LUA script, I have started with the script below and made it active. Counter is changed from 0 to 3, no changes after that....
commandArray = {}
if otherdevices['catlitterbox'] == "On" then
commandArray['Variable:catlitterbox'] = tostring(8)
else
commandArray['Variable:catlitterbox'] = tostring(3)
end
return commandArray
I hope somebody can help ?
Many thanks !!
Arthur
Cat litterrobot counter: it can be used as SWITCH ? LUA ?
Moderator: leecollings
-
- Posts: 30
- Joined: Friday 03 October 2014 22:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Contact:
Cat litterrobot counter: it can be used as SWITCH ? LUA ?
- Attachments
-
- tiltsensor.jpg (136.41 KiB) Viewed 2909 times
-
- Litter-Robot.jpg (18.71 KiB) Viewed 2912 times
-
- BinarySwitchSensor .txt
- (2.32 KiB) Downloaded 84 times
Who is online
Users browsing this forum: No registered users and 0 guests