Comments (5)
Now call
SysVar.setEnum
with{name: "Test", valueList: "Bar"}
. The result will return some invalid JSON (#113), but will "Bar" is successfully selected.
Please show the actual payload you are sending and the concrete example response which you feel is invalid JSON. And please state if you have tested this also already with RaspberryMatic.
from occu.
Sure, payload for SysVar.createEnum
:
"{"name":"Test","valList":"Foo;Bar;Other","internal":"0","chnID":"-1"}
Response is successful:
{"version": "1.1","result": {'name':'Test','id':'6968','value':'Foo;Bar;Other' },"error": null}
Payload for SysVar.setEnum
:
{"name":"Test","valueList":"Bar"}
Response is successful but invalid syntax (#113 is discussing this issue and has a fix, i just mentioned it):
{"version": "1.1","result": Bar,"error": null}
Next Payload for SysVar.getValueByName
:
{"name":"Test"}
Response is successful but looks wrong to me:
{"version": "1.1","result": "0","error": null}
"0"
is not the right value, as we just set it to "Bar".
SysVar.getAll
will now list valueList: "Bar"
for this variable.
It's not tested with RasperryMatic, i will try it tomorrow.
Am i using the whole ENUM type wrong? My expectation was to define a list (valueList) of allowed values and to select one of these as current value. The documentation for SysVar.setEnum
describes the method to "set the value", but expects "valueList" as parameter, maybe it's not a bug but a missunderstanding.
Here some example for a boolean variable:
{
"id": "950",
"name": "${sysVarPresence}",
"type": "LOGIC",
"unit": "",
"value": "true",
"channelId": "65535",
"valueName0": "${sysVarPresenceNotPresent}",
"valueName1": "${sysVarPresencePresent}",
"isLogged": false,
"isVisible": true,
"isInternal": false
}
The value
is as expected and can be seen in the WebUI.
My new conclusion is: SysVar.setEnum
is just doing the absolute wrong thing. It should expect the value
parameter as zero-based index integer and update the variable. Instead it only will update the valueList
, so there is no way to set a value using JSON API.
from occu.
Am i using the whole ENUM type wrong? My expectation was to define a list (valueList) of allowed values and to select one of these as current value. The documentation for
SysVar.setEnum
describes the method to "set the value", but expects "valueList" as parameter, maybe it's not a bug but a missunderstanding.
Yes, you are IMHO expecting SysVar.setEnum
to do something different. setEnum ist doing the exact same thing like creating a new valuelist variable. That means you use this function to actually set/change the value list and not the value of the sysvar itself. That's exactly why you supply a valueList
and not just a value
.
from occu.
Next Payload for
SysVar.getValueByName
:{"name":"Test"}
Response is successful but looks wrong to me:
{"version": "1.1","result": "0","error": null}
"0"
is not the right value, as we just set it to "Bar".
"0" is a perfectly fine result here. You misunderstanding is, that you expect the actual value to be returned by SysVar.getValueByName
for a valueList SysVar. But this is not the case. This method will return the actual index of the valueList as a value. Thus, the only "wrong" or incorrect thing in this issue ticket is the incorrect syntax of the SysVar.setEnum
response json, which I will fix in the course of the RaspberryMatic development. This respository here is anyway the wrong one since no eq3 employee will take it and fix it. The right way is to post such things in the RaspberryMatic github and then a fix might flow back to the original CCU3 firmware one day...
from occu.
I got caught by the comment in the method, "Setzt den Wert einer Systemvariable", i was wondering why it asks for valueList
but it was to logical for me, that this method should set the value 😄. At least setFloat
and setBool
are actual setting the value as expected, i will switch over to use some integer values to trigger my events.
from occu.
Related Issues (20)
- XML-RPC -> Controlling LEVEL_2 of HmIP-BBL alone does not work
- missing UNIT in paramsetDescription for LEVEL of HmIP-BDT.DIMMER_TRANSMITTER.2
- Interface URLs are incorrect
- OpenSource HMIPServer HOT 2
- Interface.reportValueUsage file is missing
- Typo in cp_software.cgi HOT 3
- HMIP HDM1 LEVEL between 0 and 1
- Paramset Data for Virtual Devices API are inconsistent HOT 1
- JSON API SysVar.createBool returns invalid json HOT 4
- Invalid RSSI_DEVICE values via xmlrpc if a HMIP HAP is present
- Umstieg von OCCU Home Assistant AddOn zu Rasperrymatic
- Invalid XML in `/tclrega.exe` XML postamble
- JSON API SysVar.deleteSysVarByName only softdeletes HOT 4
- JSON API SysVar.createEnum will always be internal HOT 3
- JSON-RPC API: Whats the prefered way to aquire a _session_id_ from my CCu3? HOT 3
- Alle HmIP-Devices auf Kommunikationsstörung nach erstem Aufruf GetDatapointsByDevice
- HmIPW-SCTHD Heizgruppen
- HMIP-SWDO bietet Status offen/geschlossen nicht in Programmen auf der CCU3 an. HOT 8
- Access to all 6 heating / cooling week profiles via room
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from occu.