Navien, ESP32 Navilink interface

@kkopachev - Thanks! I was going down the same path but since mine is not installed yet, I was not seeing anything and wasn’t sure whether the RS485 base needed to be supported with some custom component given it also has i2c which we are not using. I wonder what it is for… will research.

I want to place the ESP outside the chassis, probably using a magnet to attach on a side, so I need a longer cable. I wish I could find the XHB connectors to crimp on amazon but no luck yet. Also, not sure I want a huge number for just one connector given I don’t typically use them.

Has some of this communication happened without an NaviLink in place?

My 10-pack of connectors with 300mm cables is currently crossing the pacific. Happy to send a couple your way once they land.

Hey @vodkatea Yes this is running stand alone. I don’t even own a Navilink device.

This is an amazing thing to watch developing. I have a Navien boiler that I would like to monitor remotely at my off-grid cabin, and it looks like all the work to get what I want has already been done on this thread (mostly by tsquared & suva – great work!). I already developed a whole client-server-esp8266 system for remote control and monitoring before I even found out about HomeAssistant. (I’ve put it all on Github under my judasgutenberg account. GitHub - judasgutenberg/Esp8266_RemoteControl: A server-client system for remotely controlling distant services using Esp8266s and a PHP web server. ) Next weekend when I am at the cabin I will see if I can put this info to use and perhaps give this thread an update of what I find.

@brystmar - Thank you for the offer! I just realized that my favorite connectors for my own projects are JST-XH and that they fit nicely into the XHB socket even though they don’t have a retainer clip. I did order a set of 20 5P XHB connectors, also on their way across the Pacific, but I can make a cable today using the XH connectors and just secure it to the cable next to it for the time being. This way, I can try to contribute more meaningfully to the project right away :slight_smile:

In reviewing the code, it is all in “standard” (sorry, using this term always makes me laugh… given the only countries that don’t use Metric are United States, Liberia, and Myanmar). While I live in the USA, I am European and prefer the Metric system so I’ll be working to adapt the code to show both units. I need both so I can compare apples to apples when looking at bills for example.

Edit: Cable finished (with temporary XH connector). I used silicone wires to keep it nice and bendy and also in case of heat exposure. For the nit-picky :wink: I used yellow instead of red as in my projects red is always 5V and yellow is 12V as in this case.

5 Likes

@tsquared et al., you rock! I plugged in the ESP32 and it seems to work flawlessly! I thought the code converted everything to “standard” but it is only partial so I will try to add new entities to show metric as well.

@tsquared - I believe I read one of your posts stating you are looking into implementing the “hot button” functionality, is that correct? I mean the ability to press the button via HA. While I do not have the PCB, I do have the pump in the heater and am planning on adding the loop so I can enable it. Luckily I have easy access to the plumbing where needed. Would I need the PCB if implemented in HA? I would assume not… but… :man_shrugging:

Edit: Actually, I was totally off… the majority is already in metric :smiley:

Edit2: While the XH connector does not have retention clip, once I installed the wires in the shell and plugged it in, I found that it makes a very solid connection and it is hard to pull it out so likely totally fine as is.

@aruffell Glad this worked - I love the M5 stack solution! It’s so neat & tidy - great find @kkopachev! Mine is on the way!

@aruffell It’s funny you ask about the “standard” vs metric. I originally wrote it all in “standard” and then realized that when you import them into HA, the frontend of HA does the conversion for you depending on which you have your settings configured for! So, I went back and changed it all so that it was provided in metric and selectable by the users front end settings. Glad this worked also! :slight_smile:
Your question about the hot button - Well that was my original intent, Yes. However, I have a NPE-210S which apparently does not support this feature (doh!), and thus does not allow for this board so I am not 100% sure if it’s necessary or not.

Bummer that @tsquared’s Navien doesn’t support HotButton. That said, it’s entirely possible that the unit actually does support it and the trigger simply isn’t exposed to the user in their first-party app. Worth a shot, right?

Fortunately my NPE-240A2 officially supports HotButton, and I’d love the ability to trigger that via HA. @aruffell: Mind leaving some breadcrumbs as you implement this? I’d love to follow along and learn more about this stuff.

Just received my M5 stack order. Gonna attempting flashing everything now so I’m ready to rock once my connectors finish their swim across the ocean :sunglasses:.

One more thing: that cable braid & heatshrink is beautiful, @aruffell. I’ve seen that done before but never attempted it myself. What products & tools would I need to do something similar? I’d love to add a level of polish to my projects.

I may have found a bug in your config. It’s probably moot since you discovered HA localizes imperial units to/from metric based on your profile settings. Here it is anyway.

In a comment, you mention to multiply the cubic meter value by 0.3508 to convert to therms. Your lambda function appears to multiply by 0.358 instead:

- platform: template
    name: "Total Gas Use Therms"
    id: total_gas_use_therms  # multiply by 0.3508 to get therms
    icon: mdi:gas-cylinder
    unit_of_measurement: therms
    accuracy_decimals: 1
    lambda: |-
      return (id(total_gas_use_m3).state * 0.358);

Typo aside, is this the correct conversion rate for natural gas in the US?

Insert obligatory agreement that imperial units are silly and we really should stop using them.

1 Like

@brystmar I don’t have a hot button pcb installed, and I wonder if one is even needed when, assuming it’s possible, one is controlling it via HA. I will look into getting one to see what is sent over the 485 bus but first I need to figure out how to sniff the traffic, and ideally have both the Navilink and the ESPHome connected. I don’t have much experience with this and neither a lot of time to dedicate to it.

@tsquared I was wondering why the temperature setting, which should be a set and forget setting, uses the climate controller? I believe it adds unnecessary complications and believe it would be best accomplished with a simple number input. I will likely try that when I get a moment to do so.

It’s the same typo in comment with LPM/GPM and m³/therms (the comments both say multiply instead of divide in one of them)

The exact multiplier value for m³ → therms seems to be different anywhere I look though.

Oh I wasn’t suggesting a physical button. Any HA entity that can function as a soft button would be great. I’d love to build an automation that tells the Navien to start heating water immediately, without needing to open a hot water tap first. That’s what I assumed the HotButton feature accomplished. I’m still learning here, so it’s entirely possible I am misunderstanding both HotButton and the existing config.

Agreed on the climate entity btw. Changing this also allows us remove the fake switch too, right?

Isn’t HotButton primarily useful with external recirculation feature? It basically triggers recirculation “when needed” instead of being constantly on (which would be wasteful most of the time).

You’re right:

At the push of a button, the Navien HotButton activates the internal recirculation pump and gas fired burner to heat water in supply lines. This gives your customers hot water when they need it, saving water and money.

Sorry about the confusion!

@brystmar you probably did find a typo/conversion rate inconsistencies. Funny enough - As @dasp points out I think I found about 10 different conversion rates for that depending on where I looked. I think I may have ended up using one from one of the online converters, but it (or maybe, I) rounded to 3 decimal places. Unfortunately, I am unable to recall. I thought I did good with the notes added, but of course - I wouldn’t have a source for the items in question! :slight_smile:

@dasp I’ll have to go back and check - I may have inadvertently copy/pasted the comment, but changed the multiply/divide number - even though the metric items are the standard units that come from the device. Oops - I’ll have the check that and edit the original post.

@aruffell @brystmar The temperature setting was an idea - the thought behind it was: it really is a “temperature control device” - So, I went with the climate controller where I was going to try and incorporate both the setpoint temperature, as well as the enable/disable into one single that climate controller. Which would have provided a nice thermostat type setting for the lovelace dashboard. However, once I realized that it would/could technically “shut off” when reaching temperature, I then decided to go a different route - hence - the “fake switch” I did try to utilize a swipe and type box for the setpoint - though I was unsuccessful, So, I left it as it was because I was a bit stumped and I wanted to get a rough copy out there to continue this discussion! So thank you for asking the question! Now I’m really interested in what others have used for Hot Water Heater setpoints? Slider/Swipe n Type/climate controller, etc?

For modifications moving forward, this is what I think I heard so far.

  1. Confirm/Revise the multipliers and the respective comments.
  2. Remove climate controller, and provide different interface to adjust setpoint.
  3. Remove “fake switch” as it would no longer be necessary.

Anything I missed?

I am definitely appreciating all the interaction here! This is great! My M5 Stack with the 485 board just showed up, so I hopefully can create a work of art just the way @aruffell has!

AI Disclaimer: I got this answer from ChatGPT and have not researched it to verify how correct it is, BUT it sounds completely reasonable and would 100% explain why there isn’t a single standard constant:

The conversion from cubic meters of gas to therms is not entirely straightforward or standardized because it depends on the specific energy content of the gas being measured. Different types of natural gas have varying calorific values, meaning the amount of energy contained in a cubic meter of gas can differ based on its composition.

It also stated that natural gas may contain other gasses which will affect the calorific value. This means that while there may be a constant for the main gas delivered to our home, it will likely never be accurate. I would check with the local gas company to see what value they use in their calculations if they include it on their bill. I am guessing they picked a number as the exact composition also likely changes. Either way, one could have a way for the user to enter the value in the YAML, or even in the device page to make it even easier.

I would likely just not have it at all as I only care about consumption and don’t have a use for “therms”. I guess if I had a choice to pick which gas composition to use, then it would be relevant.

I’m removing the therms from my config, since the utility charges for CCF, so therms aren’t needed. Are therms common as billable unit?

I just checked my bill, and no trace of therms, but it may vary with region and/or supplier. This is what my bill looks like, and yes mine is in CCF too.

image

@aruffell @dasp This is interesting. While my provider does measure in CCF, they also show, and bill for therms. Interesting enough - you pushed me to find that they actually show the “therm factor” on my bill, or the conversion factor that they actually use - should make it a bit more accurate for the calculation at hand. My bill shown below for reference:

image

Full Disclosure regarding the calculations - I believe somewhere along the thread here - I was, and still am a bit unsure about some of these calculations and their accuracies so anyone who is more well versed at confirming these values - your help here is appreciated!

Also - due to this discussion, I think it may not actually be Therms anyway - but the CCF you are looking for. No? Anyway - I updated my config to now show all 3 values, cubic meters, CCF, & Therms. As a side note, to make life easier, You can change the

internal: False

to

internal: True

if you wanted to get rid of any of these from your display/lovelace dashboard.

Below is the updated portion of the template sensors for all of these.

- platform: template
    name: "Total Gas Use Cubic Meters"
    id: total_gas_use_m3 # divide by 2.832 to get CCF
    icon: mdi:gas-cylinder
    unit_of_measurement: m³
    accuracy_decimals: 1
    internal: False
  - platform: template
    name: "Total Gas Use CCF"
    id: total_gas_use_ccf # this is derived from the entity Total Gas Use Cubic Meters and converts to CCF for comparison to US energy bills.
    icon: mdi:gas-cylinder
    unit_of_measurement: CCF
    accuracy_decimals: 1
    internal: False
    lambda: |-
      return (id(total_gas_use_m3).state/2.832);
  - platform: template
    name: "Total Gas Use Therms"
    id: total_gas_use_therms # this is derived from the entity Total Gas Use CCF and one of the typical measurements for the utility company to bill against in the US.
    icon: mdi:gas-cylinder   # this multiplier 1.02845 was obtained from my energy bill - it is known as "Therm Factor" on my bill
    unit_of_measurement: therms
    accuracy_decimals: 1
    internal: False
    lambda: |-
      return (id(total_gas_use_ccf).state * 1.02845);