using 3.6694 - compiled version.
Python is running fine.
Tried to create a plugin with SetPoint Thermostat - but something is wrong...
I have added a SetPoint device, all seems to be ok.
Changing the value in UI - using the "Edit" button - the value will be changed in UI - and in database.
Requesting the value from Python it will not be changed.
Only after restarting domoticz the last value will be shown.
I use normal debug while HeartBeat for testing:
Code: Select all
Domoticz.Debug("Device: " + str(x) + " - " + str(Devices[x]))
Domoticz.Debug("Device ID: '" + str(Devices[x].ID) + "'")
Domoticz.Debug("Device Name: '" + Devices[x].Name + "'")
Domoticz.Debug("Device nValue: " + str(Devices[x].nValue))
Domoticz.Debug("Device sValue: '" + Devices[x].sValue + "'")
Domoticz.Debug("Device LastLevel: " + str(Devices[x].LastLevel))
Code: Select all
2017-02-12 19:40:21.525 (hz11) onHeartbeat called
2017-02-12 19:40:21.525 (hz11) 'HardwareID':'9'
2017-02-12 19:40:21.525 (hz11) 'Port':'80'
2017-02-12 19:40:21.525 (hz11) 'Address':'127.0.0.1'
2017-02-12 19:40:21.525 (hz11) 'Version':'1.0.0'
2017-02-12 19:40:21.525 (hz11) 'HomeFolder':'/var/tmp/domo/dev-domoticz/plugins/Hzg/'
2017-02-12 19:40:21.525 (hz11) 'Mode3':'True'
2017-02-12 19:40:21.525 (hz11) 'Key':'Hzg1'
2017-02-12 19:40:21.525 (hz11) 'Mode6':'Debug'
2017-02-12 19:40:21.526 (hz11) 'Author':'nobody'
2017-02-12 19:40:21.526 (hz11) 'Name':'hz11'
2017-02-12 19:40:21.526 (hz11) Device count: 1
2017-02-12 19:40:21.526 (hz11) Device: 1 - ID: 7, Name: 'hz11 - Heizung2Set', nValue: 2, sValue: '25.00'
2017-02-12 19:40:21.526 (hz11) Device ID: '7'
2017-02-12 19:40:21.526 (hz11) Device Name: 'hz11 - Heizung2Set'
2017-02-12 19:40:21.526 (hz11) Device nValue: 2
2017-02-12 19:40:21.526 (hz11) Device sValue: '25.00'
2017-02-12 19:40:21.526 (hz11) Device LastLevel: 0
How can I request the right sValue from Element?
Even if I update the nValue (19) for this Element in SQLite database, do not get the right one back...
Code: Select all
7|9|0000009|1|hz11 - Heizung2Set|1|242|1|0|0|12|255|19|22.00|2017-02-12 19:21:17|7|0.0|1.0|0.0|1.0|||0|0|0||
UPDATE SOLUTION: (thanks to Dnpwwo):
Dnpwwo wrote:....That said, if you have a need to handle other things updating Domoticz values outside the plugin use:to force synchronization as required.Code: Select all
Devices[x].Refresh()