I am interested in implementing this, have read @KinDR posts and note his GitHub link for the smart shunt:
But I do lack some understanding/knowledge, in particular about Step 2.
I have:
Home Assistant
A Victron Smart Shunt
An ESP8266MOD board
Some short wires and connector pins
ESPHome integration already in use in Home Assistant (I have some smart plugs which use ESPHome).
Step 1.
I can connect the pins OK.
I assume I need to supply power to the ESP8266 board, which I would do via the boardâs USB input and a regular AC plug in power supply.
Step 2.
Iâve little idea on how to do this. Any pointers would be appreciated.
I use a Macbook.
Step 3.
I already have the HA ESPHome integration running.
How do I initiate discovery so ESPHome detects the ESP8266 board?
Step 4.
Iâm not clear what else is needed. It looks like some yaml code is required in the HA config file. I see some code in KinDRâs github page but Iâm unsure which goes where.
Thanks for any help. This is my first time attempting such a thing with an ESP board.
Step 2 - there are several ways to achieve. Maybe this one will be easiest for you:
Create âNEW DEVICEâ in ESPHome (in your HA system). Once the YAML file is created you may then copy the parts of it from KinDR007 github example.
Then you install the file - again, there are few ways and maybe the easiest woudl be to use your browser on your computer - you also nee to have ESP8266 connected to the USB of the computer. I hope this works on Mac (I use Windows) - basically computer discover new device connected to USB (ESP8266) and then browser has software to install YAML file to this device. Once done and provided you have enabled WiFi the next updates you may do OTA (Over The Air) just from your HA.
If I look at my ESPHome integration in HA there is no such option to create a new device. All I see is a card with a list of devices:
If I click on one of the device menus it relates to that device only.
But assuming we get past that hurdleâŚ
I plugged the ESP board into the Macâs USB port. It flashed a blue light on the board very briefly.
But then what?
Is there an IP address I navigate to?
I think it creates its own wifi network, which I can join, but thatâs it. It doesnât guide me to a browser page or anything like that, which is what an ESPHome smart plug does, takes me straight to a config menu to set it up on my local network, and then it is auto discovered by HA.
But I see nothing / donât know where to look. It doesnât appear in my Finder in the way a plug in USB memory stick would appear.
Apologies but never used these before and I am not an IT/comms type of guy.
Step 2. âNEW DEVICEâ is not where at the integration section but at the Add-on.
Check this info: Getting Started with ESPHome and Home Assistant â ESPHome - I hope it can explain step-by-step.
Also this page may help: https://web.esphome.io/ when flashing from web.
Maybe here is some answer https://peyanski.com/complete-esphome-installation-guide/
In general, once you connect your ESP device to USB port, your computer should detect it and then your browser can use this connection to flash it. Once flashed it will connect to your HA instance and then you could change/update it with no need to connect to computer.
But I am not sure it this also fully works like that on Mac. I am sure you can google this info - there should be plenty info out thereâŚ
Thanks, I have managed to open the ESPHome app in HA and tried to follow the linked instructions but I am stuck again with no clue. I had no idea this app existed, nor that this is what was required or meant by the previous instructions.
So much presumed knowledge!
I tried to follow the instructions as best I could but frankly I have no idea if what I did was correct or not.
In the end it created a yaml file in config/esphome and I see this in the ESPHome app menu:
but here I am stuck. The documentation completely glosses over this part and just assumes you know what you are doing.
I tried connecting it to the USB port of my Mac and choosing the âPlug into this computerâ option, but I get nothing.
I tried plugging it into a USB port on my HA server, but same thing. It only sees my Conbee II stick, so given thatâs the only option I select it and it then opens some random terminal window and a whole stream of text appears, and ends with a bunch of text in red with lots of error messages.
I tried the manual download but again that goes nowhere.
I can only guess that the board is just not being seen by my computers.
Thanks for the assistance but would seem I am just fumbling in the dark without a clue.
I think we are getting thereâŚ
I recommend you use âPlug into the computer running ESPHome Dashboardâ which is your HA server (are you running it on Raspbbery Pi ?).
There you should be able to see another device on top of your Conbee stick. See a
example below (I just plugged in my ESP8266 to my raspberry) - the ESP appeared as USB2.0-Ser!:
From my memory sometimes you need to refresh the add-on or even restart your HA with ESP8266 plugged into USB port on your server in order for this option to appear.
Once you have it use this one and that should load the newly created device yaml file (compiled) into your ESP8266.
Good Luck!
Tried that, my HA is running on a mini PC inside a Proxmox VM. I swapped over from the RPi about a month back. That was a day spent with some very generous assistance to guide me through as I had little hope of doing it myself. Happy I have made that move as the new set up is way faster and I feel is likely to be much more robust than the RPiâs SD card.
When I look at the hardware options within my Proxmox HA VM, if I click to add a USB device it only shows the Conbee II stick, no other options appear.
Iâll have a go at a reboot of the Proxmox server and HAOS on VM to see if a new device shows up.
After multiple failed attempts connecting the device to both my HA server PC and my Mac, I eventually tried a different USB cable today and I was able to see the device on my Mac (but not on the HA server). Annoying that it was the cable that was the problem but at least Iâm in and can make a bit more progress.
I installed the âPrepared for First Useâ basic set up onto the ESP board and I have managed to get it connected to my WiFi, renamed it âVictron Smartshuntâ and it is now showing in my HA ESPHome page ready for the next step:
I recommend learning how to use esptool. AFAIK it is cross platform but I use it in Linux just fine. esptool -p /dev/ttyUSB0 write_flash 0x0 yourfirmware.bin . It really is that simple. If esptool runs on Windows it would be -p COM3 or similar most likely. And Mac might be similar to Linux. Just do Manual Download and Modern. Once flashed over USB everything else is OTA.
I am not an IT/comms guy. Itâs like you are speaking a foreign language.
My expertise lies elsewhere. I do try to read the guides and search, but there is often a lot of assumed knowledge/experience within IT documentation and often I hit a roadblock where canât interpret the road signs.
Since you did get as far as installing the base esphome on your device then yes, just paste the rest of the code then you can save the file. Then hit the 3 dots and Validate. If no errors do âInstallâ and âWirelesslyâ.
Thanks, went to try that but the device will no longer connect to wifi. No idea what the problem is, it connected yesterday as you saw with my images above.
I connected it to my Mac again and looked at the log .
It keeps scanning for networks, finding them, not connecting and timing out. According to the log it is seeing network with good signal strength but wonât connect.
[I][wifi:257]: WiFi Connecting to 'Telstra25BEB0'...
[W][wifi_esp8266:212]: wifi_apply_hostname_(esphome-web-82e879): lwIP error -16 on interface st (index 0)
[W][wifi:549]: Error while connecting to network.
[I][wifi:257]: WiFi Connecting to 'Telstra25BEB0'...
[W][wifi_esp8266:212]: wifi_apply_hostname_(esphome-web-82e879): lwIP error -16 on interface st (index 0)
[W][wifi:543]: Timeout while connecting to WiFi.
[D][wifi:386]: Starting scan...
[D][wifi:401]: Found networks:
[I][wifi:444]: - 'Telstra25BEB0' [redacted]ââââ
[D][wifi:446]: Channel: 11
[D][wifi:447]: RSSI: -31 dB
[I][wifi:444]: - 'Telstra25BEB0' [redacted]ââââ
[D][wifi:446]: Channel: 2
[D][wifi:447]: RSSI: -59 dB
[I][wifi:444]: - 'Telstra25BEB0' [redacted]ââââ
[D][wifi:446]: Channel: 1
[D][wifi:447]: RSSI: -65 dB
[I][wifi:444]: - 'Telstra25BEB0' [redacted]ââââ
[D][wifi:446]: Channel: 1
[D][wifi:447]: RSSI: -33 dB
[D][wifi:449]: - [redacted] [redacted]ââââ
[I][wifi:257]: WiFi Connecting to 'Telstra25BEB0'...
[W][wifi_esp8266:212]: wifi_apply_hostname_(esphome-web-82e879): lwIP error -16 on interface st (index 0)
[W][wifi:549]: Error while connecting to network.
[I][wifi:257]: WiFi Connecting to 'Telstra25BEB0'...
[W][wifi_esp8266:212]: wifi_apply_hostname_(esphome-web-82e879): lwIP error -16 on interface st (index 0)
[W][wifi:543]: Timeout while connecting to WiFi.
OK, update, after a long time it seems to have connected. Not particularly reassuring that it drops offline for so long, especially if I hope to use it for battery monitoring.
Not sure what that means. I looked up and came across this:
hoping it might shed some light for me but not really. I tried changing the line
rx_pin: D7
with
rx_pin: GPIO7
but that just resulted in a different error.
Next, were the following. Looks like a spelling error for this one:
[instantaneous_power] is an invalid option for [sensor.victron_smart_shunt]. Did you mean [instanteneous_power], [panel_power]?
instantaneous_power:
name: instantaneous power
id: instantaneous_power
When I replaced it with the incorrect spelling of instanteneous for instantaneous then the error was resolved.
Then this one:
[bmv_alarm] is an invalid option for [sensor.victron_smart_shunt]. Did you mean [bmv_alarm_text]?
bmv_alarm:
name: BMV alarm
id: bmv_alarm
So I changed it to the suggested bmv_alarm_text and again the error was resolved.
Finally:
[bmv_pid] is an invalid option for [sensor.victron_smart_shunt]. Did you mean [pid]?
bmv_pid:
name: bmv - pid
id: bmv_pid
Since pid is already defined further up in the code, I wasnât sure what this was for, so I put hashtags in from of these lines and the error was resolved.
So now I am left with the first listed error, Cannot resolve pin name 'D7' for board esp01_1m. when I do a validation check. Bit stuck on that one.
Could you expand on what you meant when you said you started to receive harmless garbage values?
I noticed that occasionally I am seeing my battery voltage spike to 30v or drop to 0v (12v system). Im wondering if you saw similar behavior.
@wattmatters - I have a bit of feeling that many issues here are not directory related to Victron code (like initial flashing ESP modules) and thus maybe in future would be better (cleaner) to start another topic with such issuesâŚ
Now, for your WiFi issues it looks like you have several AP with the same name (working on different channels) - this might be a challenge and maybe here there are some ideas how to fix it (in therms of stability)
For your pin name âD7â issue I had it with some ESP boards. For some of them names used by producers (Like D1, D2,âŚ) are accepted by ESPHome add-on editor and for some boards not, and then you have to use GPIOnn instead. Check this site for referencing which D pin is which GPIO for your particular board.