Update a dummy temp sensor using DomoticzEvents
Moderator: leecollings
-
- Posts: 1
- Joined: Friday 13 December 2019 8:55
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Update a dummy temp sensor using DomoticzEvents
Hi,
I wrote a python Time script to manage my boiler.
I am able to read my dummy temp sensor using : DomoticzEvents.Devices["My device"].n_value_string
But I am not able to write into this device
DomoticzEvents.Devices["My device"].n_value_string = 22.5 does nothing.
I am able to manage dummy switch on/off using DomoticzEvents.Command("MySwitch", "Off") and would like to know how to do the same for my temp dummy devices.
Thanks.
I wrote a python Time script to manage my boiler.
I am able to read my dummy temp sensor using : DomoticzEvents.Devices["My device"].n_value_string
But I am not able to write into this device
DomoticzEvents.Devices["My device"].n_value_string = 22.5 does nothing.
I am able to manage dummy switch on/off using DomoticzEvents.Command("MySwitch", "Off") and would like to know how to do the same for my temp dummy devices.
Thanks.
-
- Posts: 70
- Joined: Monday 14 December 2015 22:16
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Mierlo
- Contact:
Re: Update a dummy temp sensor using DomoticzEvents
Hello,
I have a similar question.
From the python events module I can toggle switches On/Off with the DomoticzEvents.Command call, but I would like to set a dimmer to a specific level.
For now I am calling the JSON api : ("http://" + domoticzserver + "/json.htm?type=command¶m=switchlight&idx=" + idx_schuifpui + "&switchcmd=Set Level&level=" + mid_level)
But I rather would like to set the level with a native attribute from the DomoticzEvents module.
Regards
Peer
I have a similar question.
From the python events module I can toggle switches On/Off with the DomoticzEvents.Command call, but I would like to set a dimmer to a specific level.
For now I am calling the JSON api : ("http://" + domoticzserver + "/json.htm?type=command¶m=switchlight&idx=" + idx_schuifpui + "&switchcmd=Set Level&level=" + mid_level)
But I rather would like to set the level with a native attribute from the DomoticzEvents module.
Regards
Peer
-
- Posts: 2016
- Joined: Monday 02 April 2018 20:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: France
- Contact:
Re: Update a dummy temp sensor using DomoticzEvents
pretty old question, but still no answer. How can we set a value to a setpoint device while using the DomoticzEvents in python ?
Zigbee for Domoticz plugin / RPI3B+ / Electrolama ZZH-P / 45 devices
If the plugin provides you value, you can support me with a donation Paypal.
Wiki is available here.
Zigbee for Domoticz FAQ
If the plugin provides you value, you can support me with a donation Paypal.
Wiki is available here.
Zigbee for Domoticz FAQ
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Update a dummy temp sensor using DomoticzEvents
Hardly know anything from python plugins but have you tried something as setSetPoint ?
In Lua it is
Code: Select all
commandArray['SetSetPoint:MySetPointIdx']='20.5'
Code: Select all
/json.htm?type=command¶m=setsetpoint&idx=&setpoint=
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 2016
- Joined: Monday 02 April 2018 20:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: France
- Contact:
Re: Update a dummy temp sensor using DomoticzEvents
Thanks , I found it while looking into the EventSystem source codewaaren wrote: ↑Tuesday 06 October 2020 16:29Hardly know anything from python plugins but have you tried something as setSetPoint ?
In Lua it isthe APICode: Select all
commandArray['SetSetPoint:MySetPointIdx']='20.5'
Code: Select all
/json.htm?type=command¶m=setsetpoint&idx=&setpoint=

Zigbee for Domoticz plugin / RPI3B+ / Electrolama ZZH-P / 45 devices
If the plugin provides you value, you can support me with a donation Paypal.
Wiki is available here.
Zigbee for Domoticz FAQ
If the plugin provides you value, you can support me with a donation Paypal.
Wiki is available here.
Zigbee for Domoticz FAQ
-
- Posts: 2016
- Joined: Monday 02 April 2018 20:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: France
- Contact:
Re: Update a dummy temp sensor using DomoticzEvents
I'm trying to update a user variables with the following syntax but it seems that there no change happening.
What am I doing wrong ?
import DomoticzEvents as Dz
Dz.user_variables[ 'my variable' ] = "22"
What am I doing wrong ?
import DomoticzEvents as Dz
Dz.user_variables[ 'my variable' ] = "22"
Zigbee for Domoticz plugin / RPI3B+ / Electrolama ZZH-P / 45 devices
If the plugin provides you value, you can support me with a donation Paypal.
Wiki is available here.
Zigbee for Domoticz FAQ
If the plugin provides you value, you can support me with a donation Paypal.
Wiki is available here.
Zigbee for Domoticz FAQ
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Update a dummy temp sensor using DomoticzEvents
Lua does use
commandArray['Variable:MyVar']='Some value'
so it could be something along the same line. But if you read the template Python template script in the event editor, setting a uservariable is one of things on the TODO list and so likely not implemented yet (same is true for the wiki (also on the todo list) )
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 2016
- Joined: Monday 02 April 2018 20:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: France
- Contact:
Re: Update a dummy temp sensor using DomoticzEvents
thanks @waaren
Zigbee for Domoticz plugin / RPI3B+ / Electrolama ZZH-P / 45 devices
If the plugin provides you value, you can support me with a donation Paypal.
Wiki is available here.
Zigbee for Domoticz FAQ
If the plugin provides you value, you can support me with a donation Paypal.
Wiki is available here.
Zigbee for Domoticz FAQ
-
- Posts: 2
- Joined: Friday 30 October 2020 17:27
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Update a dummy temp sensor using DomoticzEvents
Looking at the sources, I found that for python :
DE.Command( 'CustomCommand:' + idx, doWhat) # I don't know how to use it and it's usage ..
DE.Command( 'SetSetpoint:' + idx, 'val1#val2#val3') # I don't know how to use it and it's usage ..
DE.Command( 'Variable:' + variable_name, value_to_affect) # OK, this one works fine
No implémentation of UpdateDevice
Regards
DE.Command( 'CustomCommand:' + idx, doWhat) # I don't know how to use it and it's usage ..
DE.Command( 'SetSetpoint:' + idx, 'val1#val2#val3') # I don't know how to use it and it's usage ..
DE.Command( 'Variable:' + variable_name, value_to_affect) # OK, this one works fine

No implémentation of UpdateDevice

Regards

Re: Update a dummy temp sensor using DomoticzEvents
I have gone into the same problem (I have a Eurotronic Spirit thermostatic valve).
Thanks to this thread and some other research and experimentation, I have found that:
The other possibilities seen in source code of DomoticzEvents module (eg. "CustomCommand") remain unknown to me (some need to go far in the code to understand what they do), and I even don't understand really how the "SetSetpoint" command does what it does (which is what I want).
There is also a DE.Devices.update() method, no idea how/what it does.
I still need to find a way to configure the "mode" of my valve (I can set it to "Heat" for maximum heating, "Eco", for lower temperature, "OFF", etc.)
Thanks to this thread and some other research and experimentation, I have found that:
Code: Select all
DE.Command('Variable:Foo', '14') # Sets User Variable "Foo" to value 14
DE.Command('SetSetpoing:123', '20') # Sets the Setpoint device of my valve to 20 (123 is the ID of the device)
DE.Command('Heater relay', 'On') # Sets my heater (name "Heater relay") to ON
There is also a DE.Devices.update() method, no idea how/what it does.
I still need to find a way to configure the "mode" of my valve (I can set it to "Heat" for maximum heating, "Eco", for lower temperature, "OFF", etc.)
Who is online
Users browsing this forum: No registered users and 1 guest