Using Home Assistant to program/control a Victron system

Me, one of these … ?
Did it a long time ago …

Well this is fun… I’ve updated my Home Assistant Core and Supervisor today. Now everything is broken. Existing code doesn’t compile, LoveLace isn’t working. Nothing. Restoring a snapshot doesn’t help…

Don’t really know why I’m posting this here, but please be on the look out for the latest HA update - It doesn’t seem to want to play along with modbus code, at least that is where I gave me an error until it just completely stopped working.

What version were you on?
My last update (not this latest one) broke stuff to do with Modbus, until I moved the sensors into the modbus section of the yaml.

1 Like

Okay let me try that.

Previously:

modbus:
	name: victron
	type: tcp
	host: 192.168.1.209
	port: 502


sensor:
- platform: modbus
  registers:
    - name: Grid power
      unit_of_measurement: "W"
      hub: victron
      slave: 100
      register: 820

Now:

modbus:
	name: victron
	type: tcp
	host: 192.168.1.209
	port: 502
	sensors:
	  - name: Grid power
		unit_of_measurement: "W"
		slave: 100
		address: 820
1 Like

I changed it like that, restarted, and then the entire UI broke… will try again when I get home. Thanks!

Jip, same here … had to fix as per MongooseMan.

But still a few errors remain, but all works again.

This is the sort of thing that makes me loath to update anything. I swear I don’t even want to dist-upgrade my ubuntu laptops anymore. It’s literally less effort to replace the laptop every 3 years or so and just install whatever is new at the time… then run it forever :slight_smile:

I recently had to update my parent’s laptops, over the internet. Both of them hung up in the middle of the process, leaving them unbootable. Now I was expecting the possibility of at least one of them doing this (so I didn’t do them at the same time), but I didn’t expect both of them to do that.

It took a rescue stick and a phone call to just get them back on the internet to finish the process.

If it works… leave it the heck alone.

:slight_smile:

2 Likes

Here, let me show you … :laughing:

Wow! This is the weirdest thing.

When I first updated and I saw the sensors not working, I tried restarting HA. Didn’t want to due to the “hub” part of the code being present. I moved everything over to my modbus.yaml, deleted hub and changed register to address (stepwise updates based on error feedback).

Code compiled perfectly and I restarted. Then my Lovelace interest was completely broken. Showed me some error with “reload GUI” button. Which obviously did nothing. I googled, and found that many people had this issue (after fixing modbus code, Lovelace is broken)

I restored my latest snapshot (taken just before the update) and obviously it didn’t fix anything (because the latest HA version was still running) but at least I was back at a position where Lovelace worked.

I did everything again, no different from the first time (except with less trial and error, because I know knew to move modbus sensors into the modbus.yaml file, about removing hub and renaming register)… Now it worked. Madness.

Don’t ever try to tell me that computer do exactly what you tell them. You really do not know all the weirdness going on in the background.

100% agree. ASUS has been begging me to update my BIOS for the last 7 years. Do they think I am crazy? There should be absolutely no reason to update my BIOS if it is working.

I wanted to get the latest HA because of the Energy thing…

No. @gbyleveldt

?!? What did I do?

I totally get this. Also weird since I used to be the first to update to the latest beta version of whatever came out - whether it was Windows or OSX or some phone’s firmware etc.

Now I have a Home Assistant which has become fairly critical to my house, and I dread every update as well. Most of time - 90% - it just works. 5% of the time I have to change some config. The other 5% I haven’t really encountered yet, but that’s what seems @jykenmynie got this time round. It is even worse when you skip a couple of upgrades and have to work through multiple change logs to see what config you might have to modify.

In terms of OS updates:

  • I have an Ubuntu machine that I really don’t upgrade that often, since the Network Bridge that I setup to get Home Assistant working is already flaky and I fear I’m going to have to solve it from the start
  • I have an old Windows machine which tries about twice a month to update from Windows 10 2019-08 or something to the latest edition, only to fail and restore again, then immediately tells me I need to update it.
  • I have a Mac (primary work machine) which is on Big Sur (latest general release). Before that I were a couple of releases behind. As I also run VMs with Windows, updating the OSX usually means I have to update the VMware that I ran too, which usually means money. When I eventually bit the bullet to update to Big Sur, the upgrade was horrific - I started on a Saturday morning and spent the whole Saturday and Sunday trying to get the machine working again because of a super weird error around the @(%&(! apple T2 chip and my user somehow losing Admin rights :anger:

:exploding_head:

They do quite a lot of updates to Modbus, I must say. Unfortunately they do introduce bugs every now and then.

Not sure if it would help if we developed a native Victron integration…

Venus 2.80 ships with an improved MQTT integration. One reason to opt for modbus was always because the mqtt integration simply uses too much CPU, too much data, sends a thousand topics when you only care about 5, and so on. That will be a thing of the past soon. Or already, if you want to brave installing 2.80~11. Although I would wait for the next candidate, the current one still has a few rough edges.

1 Like

I’m actually looking into this at the moment. Do not count unhatched chickens just yet, but I have a HA development tree set up and running, and I’m already looking at the Fronius integration to see what is needed (it seems the Fronius one uses the json-based SolarAPI… not sunspec).

Ideally I want this thing to auto-detect your Victron system, which it can do using mDNS. I still know too little about HA to say anything.

3 Likes

It is officially on the roadmap. Time permitting.

2 Likes

This is my equivalent of a Hello World app, or one step past it. I can fetch things via modbus. But it still needs a modbus hub to be defined separately. I know nothing about the guts of this, so this is simultaneously a learning school as well. Plus, this is only the second time ever that I’m doing asyncio stuff. I stagnated a bit in python2 land :slight_smile:

3 Likes

oeeee.

some interesting bits has been happening here…

will have to make some time to read this thread with some more concentration later.

atm I post or is that pull the Victron values via mqtt, and then display them on HA, but this looks interesting, the modes integration.

My primary use case for my HA is actually my Paradox alarm integration, and ye, with my MBP have always been happy to hit the upgrade, but F… the HA guys like f’ing things up, I’ve gotten allergic to that Tuesday update, as they’ve broken it so many times, or enable another security feature out of the blue breaking things.

This weeks fun was the demise of DuckDNS… or make that just the being dead again, so switched to another provider, can see I’ll be doing a paid service soon/one of these days.

G

I am doing the paid version through Nabu Casa, its working brilliantly for me, 5USd per month but it beats the struggle to open Ports through my service provider hands down.