Comments (16)
What do you mean with b)? Should the datapoint have a factor /3600?
from vitowifi.
Yes
from vitowifi.
I made an update in the V1 branch.
The device type can be queried using the RAW datapoint (remember to set the length to 2).
HOURS datatype was added.
I didn't update the docs yet! And keep in mind that this is not fully tested and there are breaking changes in the interface!
from vitowifi.
just wanted to test but I see you made some changes.
new dp types are
dpManager.addDP("Raw", "DPs", 0x00, RAW).setLength(4);
dpManager.addDP("TempL", "DPs", 0x00, TEMPL);
dpManager.addDP("TempS", "DPs", 0x00, TEMPS);
dpManager.addDP("Stat", "DPs", 0x00, STAT);
dpManager.addDP("CountL", "DPs", 0x00, COUNTL);
dpManager.addDP("CountS", "DPs", 0x00, COUNTS);
dpManager.addDP("Mode", "DPs", 0x00, MODE);
dpManager.addDP("Hours", "DPs", 0x00, HOURS);
dpManager.addDP("CoP", "DPs", 0x00, COP);
Can you quickly cross-reference the new names to the old ones ? I use TEMP now, this has become now TEMPS or TEMPL ?
Is HOURS DP the seconds to hours conversion for the operating time?
from vitowifi.
temp is now templ. Hours is indeed seconds to hours.
I didn't update the docs (or actually rewrite) yet. Current implemented DPs are listed in datapoint.h
from vitowifi.
In datapoint.cpp (near the end) you can see which DP belongs to which "conversion". The template parameter stands for "conversion - number of bytes - factor - return type". The return type is chosen as most appropriate for the value it must hold eg: a counter is an unsigned int, an on/off status is a boolean...
Note that when you try to read the wrong type, it gives a hardcoded default value.
from vitowifi.
Got it.
My script is running, the conversion seems to work. Thanks.
About that raw DP: if I had the wicked idea of scanning all 0xffff addresses of the vito, using addDatapoint would allow me to add 0x100 DPs until I run out of memory.
Can I do a read directly without the queue? Or should there be a removeDatapoint method ?
from vitowifi.
I didn't do the math, but I assume memory is indeed an issue.
A removeDatapoint would also imply to scan the queue so there's nothing scheduled using that datapoint. But both datapoint deletion and action deletion are not optimized as they are stored in a vector/queue and they are not intended for random deletions. I would like the lib's use case to be mainly long term connection. A datapoint detective is more of a one-time thing.
So my approach here would be to use the optolink directly and query the addresses one by one, with different length. Just have 1 datapoint of eacht type to be able to do the conversions. A little bit like the rawOptolink and the Datapoints examples combined.
I'll write such an example, but I've got some deadlines to meet at work (so it'll be for the end of the week). If you come up with something, feel free to share and make a pull request!
from vitowifi.
A question: how do you see the sniffer? I was thinking the following:
Query a address for 1, 2 and 4 bytes; print the possible values and they move on to the next address?
from vitowifi.
Well, almost - yes.
It is my understanding that the vito does answer ok even if you request 4 bytes from an 4 byte address. It does return an error if you read 2 byte from an 4-byte address. Is this intended ? Seems odd to me.
So, best would be to try 1, 2, and 4 bytes.
I just tried to read 2/4 bytes from 0x00f8 and 0x0500 . The serial log shows:
READ 4105000100f80200
ack
RCV 4107010100f80220496c
ack
DP Gerätekennung succes
boiler-Gerätekennung:18720
READ 4105000100f80402
ack
RCV 4109010100f8042049020b7d
ack
DP Gerätekennung succes
boiler-Gerätekennung:184699168
READ 410500010500040f
ack
RCV 410901010500046d1f0000a0
ack
DP Anzahl_Einschaltungen_Verdichter succes
boiler-Anzahl_Einschaltungen_Verdichter :8045
READ 410500010500020d
ack
nack, timeout
DP Anzahl_Einschaltungen_Verdichter error: 1
If there is no answer or an error- don't print anything. The vast majority of scan attempts will fail.
Time is no factor- memory is. That scan is done once, it may as well take all night. That being said... is it possible that there are data types larger than 4?
Well and if the output is accidentally formatted in a way that would allow me to copy and paste it into my code with only a few search and replace commands ;-)
E.g.
DP: 0x1000 MostLikelyType: HOURS; Values: U8 xx U16 xxxx U32 xxxxxxxx I8...
That would allow me to replace:
DP: with VitoWifi.addDatapoint("name ","boiler",
MostLikelyType: with ",",
; Values: with "); //"
from vitowifi.
Datapoints are 1, 2, 4 or 8 bytes I think. But I didn't implement the 8 yet (time in BCD for examples I think).
Now I can't write code that evaluates whether a returned value makes sense or not. What I can do is if there is a value, print all possible conversions (currently implemented) but tthen you still have to go through all of them manually.
from vitowifi.
Now I can't write code that evaluates whether a returned value makes sense or not. What I can do is if there is a value, print all possible conversions (currently implemented) but tthen you still have to go through all of them manually.
Good enough.
Although an initial rule is simple. Usually (!)
a) Floats are -100< x <100.
b) Integer should fit comfortably, i.e. are smaller than half the max range.
c) If MSB is set- its an signed int if b) still applies.
d) if a 16 and a 32 bit value both meet b) I would pick the value that less occupies the max range (i.e. 10% compared to 12%)
from vitowifi.
OK, I'm gonna write this one out carefully before starting to code. I'm not that fluent in c++ or software design to just have this off the top of my head.
from vitowifi.
Any news on that? Is it possible to read 8bytes for switching times /systime?
from vitowifi.
I'm still alive. However, I moved temporarily and didn't use this lib for quite some time now. I'll check the code (and branches) and come back to you.
from vitowifi.
Solved in version 3 of the library. Any length can be queried and raw data is returned.
Will be "formally" published in the coming weeks.
from vitowifi.
Related Issues (20)
- Return type of _readDatapoint and _writeDatapoint HOT 1
- Compilation error at Datapoint.hpp HOT 1
- EOL for message "queue full" HOT 1
- "Betriebsart" as example delivers always "0" HOT 4
- DPCoP and group HOT 1
- 8 Byte read extension with uint64_t brings inconsistent results HOT 30
- VitoWiFi.readDatapoint() only on MQTT request HOT 5
- Serialmonitor "chksum 0x2d" HOT 4
- Blocking after 6 hours HOT 3
- Errors on high MQTT request rate HOT 9
- Keine Verbindung mit ESP32 über USB-Host möglich HOT 3
- Wemos D1 mini / Serial-Pins HOT 7
- Example for DPRaw HOT 2
- Can you explain a bit more how to install the library in Arduino IDE 2.0? HOT 4
- Queue full without any connection
- VitoWiFi 2.0 Debug funcionality HOT 7
- Solved: Vitocal300 WO1B does not start with VitoWifi attached HOT 4
- Vitoconnect passthrough HOT 12
- Up-to-date library version on PlatformIO HOT 3
- Cannot compile HOT 1
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 vitowifi.