Comments (7)
Maybe
valve_temp = (ord(es[es_pos + 0x0C]) + (ord(es[es_pos + 0x08]) & 128 ) * 2 ) / 10.0
works better...
from thermeq3.
Hello,
which version? 1xx or 2xx?
from thermeq3.
A version 1xx variant.
from thermeq3.
Please check code in 2xx version.
e.g.
lsb = ord(es[es_pos + 0x08]) & 0b01111111
msb = ((ord(es[es_pos + 0x08]) & 0b10000000) >> 7) * 256
# get set temp
valve_temp = float(lsb) / 2
# get measured temp
lsb = ord(es[es_pos + 0x0C])
valve_curr_temp = float(msb + lsb) / 10
# extract room name from this WallMountedThermostat
wall_room_id = str(self.devices[valve_adr][3])
# and update its value to current temperature as read from WallMountedthermostat
self.rooms[wall_room_id][3] = valve_curr_temp
from thermeq3.
Sorry,
I noticed the code divides with integer values: 2 and 10
So the result is an integer too.
Python 2.7.3 (default, Aug 8 2013, 22:36:42)
[GCC 4.6.4 20121210 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
11 / 2
5
11 / 2.0
5.5
Do you get only whole numbers for valve_temp and valve_curr_temp?
from thermeq3.
Hi guys I have a RPi / Python MAX Boiler controller and had the same problem. Stems from the fact that the temp is split over bytes at both ends of the message, so when it goes over 25.6 it flips the lower byte to 1 and goes back to 00 on the higher bits I solved it by building a binary text string and converting it back.
`
Get Binary at offset 8
valve_binary = "{0:08b}".format(int(self.hexify(es[es_pos + 0x08]), 16))
Use msb of offset 8 for msb of actual temperature
if valve_binary[0:1] == "1":
temp_headder = "01"
else:
temp_headder = "00"
Just use last 6 bits for set temp
valve_binary = valve_binary[-6:]
valve_temp = float(int(valve_binary, 2)) / 2 # set temp
curr_binary = "{0}{1:08b}".format(temp_headder,int(self.hexify(es[es_pos + 0x0C]), 16))
valve_curtemp = float(int(curr_binary, 2)) / 10 # measured temp
Hope that is of some use.
`
from thermeq3.
ad divide with int value of 2: there is a float(x) / 2 so the result will be float
ad msn/lsb: https://github.com/Bouni/max-cube-protocol
I'll check the code for wall mounted and HT. MSB is on bit 7 and bit 0 (HT). Fixed in V223.
from thermeq3.
Related Issues (20)
- Beta "temp" mode not working HOT 16
- Heating not heating algorithm HOT 1
- Sketch thermeq3_dht is broken HOT 1
- Saving thermeq3.bridge to internal flash HOT 7
- Nice/status web page HOT 8
- Crash course in configuration please? HOT 2
- Problem sending email HOT 6
- valve_pos is not persistent over reboot HOT 14
- Autoupdate NOT working HOT 3
- Feature request: add more information to status.json HOT 25
- Feature request: posibility to send to Cube "mode AUTO/ECO" command HOT 5
- Dasboard enhancement HOT 9
- Enhancement: REAL weather from "local source" HOT 14
- Valve without external wall thermostat always shows 0 temperature HOT 4
- Malformed "ignored" message HOT 1
- Enhancement: error reporting in bridge.json HOT 2
- Problem with permanent setting profile to term HOT 2
- Another Dashboard Enhancement HOT 1
- Problem getting bridge.json in node-red
- Autoupdate is reseted to True (after midnight?)
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 thermeq3.