Jalle19 / eda-modbus-bridge

An HTTP/MQTT bridge for Enervent EDA ventilation units
GNU General Public License v3.0
15 stars 3 forks source link

Expose device state #47

Closed Jalle19 closed 2 years ago

Jalle19 commented 2 years ago

@JohanElmis can you try this branch?

Fixes #46

Jalle19 commented 2 years ago

Strange, I enabled manual boost but the state for it remained false. Will have to check what it says the next time "RH tehostus" turns on.

JohanElmis commented 2 years ago

I will also try to test it tomorrow. I got it up and running now on my Pi that handles the FTX among other things.

JohanElmis commented 2 years ago

I don't see the changes in the states as I'm supposed to using this code. I will look at the changes and compare it with my code. (I'm just printing the state as a variable) and that one is changing - but the decoded state in this code doesn't. Looks like there are plenty of tests for the decode - So is the state reading working? Print just the state as a value - before decoding to see if that changes.

Jalle19 commented 2 years ago

Yeah I think I have to print the raw Modbus response, the value is probably not what I'm expecting.

Jalle19 commented 2 years ago

Still haven't gotten around to debugging this, will try to get it done soon

Jalle19 commented 2 years ago

Got it work, was a simple result[0] when it should have been result.data[0]...

State register value is 0
GET /summary 200 4128 - 915.934 ms
State register value is 0
GET /summary 200 4128 - 914.685 ms
State register value is 0
GET /summary 200 4128 - 935.817 ms
Received ON on topic eda/mode/overPressure/set
Updating mode overPressure to ON
State register value is 1024
GET /summary 200 4127 - 919.949 ms
Jalle19 commented 2 years ago

Working nicely, added the most interesting states (for me) to a card like this: Screenshot-20220304114556-514x324

Jalle19 commented 2 years ago

@JohanElmis @tomrosenback feel free to review, IMO this is ready now

JohanElmis commented 2 years ago

Summer night cooling twice? :-) I will try to test this as well. Nice work

Jalle19 commented 2 years ago

Yeah, noticed it too 😄

tomrosenback commented 2 years ago

Maybe a stupid question but what is the difference between state and mode?

Jalle19 commented 2 years ago

Maybe a stupid question but what is the difference between state and mode?

Not a stupid question at all. There is indeed some overlap, e.g. when you enable the "away" mode the state for "away" also turns on. However, state encompasses more than just the user-controllable modes. For example, if you have "summer night cooling" enabled, the mode will be "on", but the state for "summer night cooling" will switch to "on" only when the mode is active. Same thing with "humidity boost" - the state for it gets triggered only when the machine decides to actually enable the boost mode.

You can see the state on the control panel ("Tila", right there on the front page).