starsoccer / energysmartbridge

MQTT bridge for the EnergySmart Water Heater WiFi Controller
GNU General Public License v3.0
11 stars 3 forks source link

Smart Module ends communication after certificate is given #1

Closed Boohooligan closed 9 months ago

Boohooligan commented 9 months ago

Just for good measure, I wiped the raspberry pi 3b+ my previous attempts were set up on and did a fresh install of DietPi OS and Docker. Cloned your repo, built it, configured the docker-compose.yml. Here is where I'm at with it.

Pi-hole is successfully routing energysmartwaterheater.com and devices.irissmarthome.com to the RPi.

MQTT is showing online in home assistant and the energysmart topic is available, though only showing status=online.

Wireshark is showing the smart module contacting the server, initial handshake (syn, syn ack, etc), then a client hello over TLSv1, the nginx proxy responds and provides the certificate, then the smart module sends a fin ack, indicating it's done. It's never offering up any of the data.

Proxy container IS able to ping the bridge container. The bridge does fail several times to set up the listen on port 8001 before finally working, unsure if this is normal behavior or not.

Unsure how to get more detailed logging from the nginx proxy.

starsoccer commented 9 months ago

In a strange twist of fate though, I've lost my uppertemp_state and lowertemp_state sensors in HA. It's still reporting in MQTT, but HA doesn't automatically keep them there anymore. I added to my configuration.yaml and those new ones populate.

Can you elaborate? I don't think I ever had them showing directly. They are just part of the water heater thermastat not sensors

starsoccer commented 9 months ago

Ok, I got this all figured out now. Part of it was a network problem at my house that I managed to fix.

Grid state does not matter for changing temperature or mode. On or off, it still works.

The temperature is fine as a float but you cannot set it above 140F via this interface. When I was testing it was mostly all 141-145 and the one time it did work yesterday was when I set it to 140. So, I'd say this all works as intended.

I think the only feature I'd like to see at this point is just the raw mode state as a sensor. I dislike the modes that HA provides in the water heater integration.

Okay great.

Its strange to me that RA has no impact on controlling it though.The temp cap makes sense. I can probably add this as a limit in HA somewhere.

I can add raw mode and the other sensors. Will try to do that this weekend or early next week

Boohooligan commented 9 months ago

Interesting that you didn't have the upper and lower sensors before. I had them, but it may have auto created from the original method via the RPi and dropped off when I had to reboot HA. Anyway, I'd guess most people don't actually care to see them and probably isn't worth putting into the integration.

I agree that control working regardless of RA state is weird, but it could be that it was always designed to accept commands from the module like that and RA could have been related to some other feature that isn't used in this implementation, like allowing the power company or some other entity control settings en masse.

Beginning some initial documentation here soon.

Actually, rather than adding them as default sensors, we can just include in the instructions if you want this add this to your yaml config. Some of those others I wish I didn't have like dry fire.

starsoccer commented 9 months ago

Interesting that you didn't have the upper and lower sensors before. I had them, but it may have auto created from the original method via the RPi and dropped off when I had to reboot HA. Anyway, I'd guess most people don't actually care to see them and probably isn't worth putting into the integration.

I agree that control working regardless of RA state is weird, but it could be that it was always designed to accept commands from the module like that and RA could have been related to some other feature that isn't used in this implementation, like allowing the power company or some other entity control settings en masse.

Beginning some initial documentation here soon.

Actually, rather than adding them as default sensors, we can just include in the instructions if you want this add this to your yaml config. Some of those others I wish I didn't have like dry fire.

Hmm maybe sill take a look when I have a chance.

Regarding other sensors, you want sensors removed? I was going to atleast add sensors for everything else so its there

Boohooligan commented 9 months ago

Oh I mean I'm not saying actually remove any, and there's no sense in excluding data somebody might want. It can easily enough be ignored if I don't care about it.

Boohooligan commented 9 months ago

0.0.3 issue > Listing Versions! nginx version: nginx/1.24.0 nginx Version: run.sh: 1: eval: Syntax error: Unterminated quoted string

starsoccer commented 9 months ago

Yeah there was a small bug with the new version. I deleted it and republished and it seems to be good now and a bunch of new sensors included raw mode I added for you. Next I am going to work on getting the mode mapping working so you can update it directly in HA

starsoccer commented 9 months ago

I just pushed a new version that is building that should fix the mode mapping. If youd like to pull that down and test it and confirm if it works for you or not.

Is there any other issues or sensors you want added? Otherwise I am thinking at this point I am going to leave it as is

Boohooligan commented 9 months ago

Works perfect! Didn't realize some of these new sensors were in the raw data.

starsoccer commented 9 months ago

Yeah there are a few others still not exposed. I am going to just add them all now so I dont need to think about it again and then will leave it. I am going to close this issue now too