Hye,
Does somebody knows if i can retrieve the level of a dummy dimmable switch to inject into ACTION ON URL , when i move the slider of the switch, this command is executed :
/cuisine.php?code=On , and i want to add the percent level to my URL , something like that : &level=[level] ?!
Is there some existing variable at the execution time that can be used ?? thanks for advice
Just for context : a moteino is connected to raspberry serial line , and IR LED send NEC code to a led stripe
Action On parameter dimmer level
Moderator: leecollings
-
- Posts: 5
- Joined: Tuesday 26 January 2016 22:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2.3530
- Contact:
Action On parameter dimmer level
raspberry cam - moteino rfm69 - Zwave Stick - IR - 433 transceiver
- nayr
- Posts: 354
- Joined: Tuesday 11 November 2014 18:42
- Target OS: Linux
- Domoticz version: github
- Location: Denver, CO - USA
- Contact:
Re: Action On parameter dimmer level
try a script_device_*.lua script like this:
Code: Select all
commandArray = {}
if (otherdevices['My Device'] == 'On') then
commandArray['OpenURL']="127.0.0.1/cuisine.php?code=On&level=" .. otherdevices_svalues["My Device"]
end
return commandArray
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
-
- Posts: 5
- Joined: Tuesday 26 January 2016 22:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2.3530
- Contact:
Re: Action On parameter dimmer level
thanks to you for answer , it's a good alternative if gui don't permit de retrieve level value.
But the property level is empty , in gui i got " Set Level: 53 %, Level: 53 %" , but in otherdevices_svalues['Cuisine_Led'] , printed in debug i got zero ??!!!
Do you have an idea ?
But the property level is empty , in gui i got " Set Level: 53 %, Level: 53 %" , but in otherdevices_svalues['Cuisine_Led'] , printed in debug i got zero ??!!!
Do you have an idea ?
raspberry cam - moteino rfm69 - Zwave Stick - IR - 433 transceiver
-
- Posts: 5
- Joined: Tuesday 26 January 2016 22:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2.3530
- Contact:
Re: Action On parameter dimmer level
This is solved now !! , here the final script working fine :
commandArray = {}
if (devicechanged['Cuisine_Led'] ) then
if (otherdevices['Cuisine_Led'] == 'Set Level') then
commandArray['OpenURL']="127.0.0.1/cuisine.php?code=Dim&level=" .. otherdevices_svalues['Cuisine_Led']
print('Level : '..tonumber(otherdevices_svalues['Cuisine_Led']))
end
return commandArray
The difference is to test equality with "Set Level" string , with this the array other devices_svalues handle the right level
Thanks again .
commandArray = {}
if (devicechanged['Cuisine_Led'] ) then
if (otherdevices['Cuisine_Led'] == 'Set Level') then
commandArray['OpenURL']="127.0.0.1/cuisine.php?code=Dim&level=" .. otherdevices_svalues['Cuisine_Led']
print('Level : '..tonumber(otherdevices_svalues['Cuisine_Led']))
end
return commandArray
The difference is to test equality with "Set Level" string , with this the array other devices_svalues handle the right level
Thanks again .
raspberry cam - moteino rfm69 - Zwave Stick - IR - 433 transceiver
-
- Posts: 784
- Joined: Wednesday 10 December 2014 13:06
- Target OS: Linux
- Domoticz version: beta
- Location: Bordeaux France
- Contact:
Re: Action On parameter dimmer level
Great ! Thanks for this.
Got same needed using Milight.
Level can't be handel on lua.
I plan to use a IR remote to drive the TV corner.
IR gateway is made with a rpi lirc and irexec.
Actually can drive scene, and turn on and off TV corner.
Got 2 buttons who are plan to drive milight dimmer one for up one for down.
Each button hit have to set dimmer +5 or -5% from thé actual level.
Off course, if light is off first press on UP button have to set light on and to 5%.
Will try to use your script.
Got same needed using Milight.
Level can't be handel on lua.
I plan to use a IR remote to drive the TV corner.
IR gateway is made with a rpi lirc and irexec.
Actually can drive scene, and turn on and off TV corner.
Got 2 buttons who are plan to drive milight dimmer one for up one for down.
Each button hit have to set dimmer +5 or -5% from thé actual level.
Off course, if light is off first press on UP button have to set light on and to 5%.
Will try to use your script.
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Re: Action On parameter dimmer level
Anybody can help me with this (Dummy Dimmer)?
script_device_VU.lua:
In log:
2017-03-23 22:07:13.005 User: Admin initiated a switch command (37/VU/Set Level)
and no Level:..... what is in the script. So it's not working. Any ideas?
script_device_VU.lua:
Code: Select all
commandArray = {}
if (devicechanged['VU'] ) then
if (otherdevices['VU'] == 'Set Level') then
commandArray['OpenURL']="http://192.168.1.99/web/vol?set=" .. otherdevices_svalues['VU']
print('Level : '..tonumber(otherdevices_svalues['VU']))
end
end
return commandArray
2017-03-23 22:07:13.005 User: Admin initiated a switch command (37/VU/Set Level)
and no Level:..... what is in the script. So it's not working. Any ideas?
-
- Posts: 112
- Joined: Monday 26 June 2017 21:16
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Spain
- Contact:
Re: Action On parameter dimmer level
I'm testing this script:
And get this error:
2019-02-24 16:53:00.212 Error: EventSystem: in prueba slider persiana: [string "--..."]:32: 'end' expected (to close 'if' at line 26) near <eof>
Line 26 is: if (devicechanged['Persiana_papas'] ) then
Any idea?
Code: Select all
commandArray = {}
if (devicechanged['Persiana_papas'] ) then
if (otherdevices['Persiana_papas'] == 'Set Level') then
commandArray['OpenURL']="http://192.168.0.117/cm?cmnd=shutterposition%20" .. otherdevices_svalues['Persiana_papas']
print('Level : '..tonumber(otherdevices_svalues['Persiana_papas']))
end
return commandArray
2019-02-24 16:53:00.212 Error: EventSystem: in prueba slider persiana: [string "--..."]:32: 'end' expected (to close 'if' at line 26) near <eof>
Line 26 is: if (devicechanged['Persiana_papas'] ) then
Any idea?
Who is online
Users browsing this forum: No registered users and 0 guests