@DavidFW1960 I tried to follow this through tot he conclusion but I couldn’t work out what the final answer was to doing this in hassio?
Also, and yes I know generally always keep up with the latest firmware, but is there benefit to upgrading all my sonoffs? I understand that from now on they all have to be physically re-flashed. Or am I wrong about that too?
is there benefit to upgrading all my sonoffs?
I think it’s a good practice to do so…
I understand that from now on they all have to be physically re-flashed. >>Or am I wrong about that too?
You’re wrong about that. Once you have Tasmota on them you can flash the latest over the air. I started with 5.12 and flashed 5.14 OTA. Only thing is you need to do it in 2 steps as the firmware is too large to fit in one hit so you flash with 5.14 minimal and then flash with 5.14 Reason is the 5.14 is larger in size than 1/2 the available ram on the Sonoff so it can’t hold both firmwares simultaneously so flashing the minimal firmware frees up enough space for the full version.
One challenge is keeping track of which firmware each device has installed etc and then update individual device configurations etc. Has anyone started tracking their sonoff device firmware and OTA upgrades within HA ?
I originally wanted to use the MQTT command but in the process of that I discovered that when Home Assistant runs a command from configuration.yaml, it runs it in the host container and the host does not have the mosquitto_sub installed hence the error. When you run it from ssh, that home assistant container DOES have the mosquitto_sub so it works. So the only way is to use the HTML way as above.
I also discovered that yaml strips that / off the HTML command and you’ll see that if you run the command @VDRainer gave me from ssh it will give you an error about the cut command not allowing 2 characters but when it was run from the yaml file it worked.
Anyway it was an interesting exercise and I learnt a lot which is 90% of my objective.
I only have 2 Sonoff devices so keeping track of them and their firmware version isn’t really an issue for me but if I had a lot I can see I’d use a spreadsheet or something like that and tick them off as I update them. I pretty much like to keep everything up-to-date as I’m less prone to get caught by breaking changes and if something breaks you can always roll back pretty easily.
Whilst this is a great idea and I’m going to do it just because, have you seen this sonWEB it will do what you want as an add on with UI for managing your sonoff devices aswell as OTA firmware.
I’m seeing the same - no errors, just an empty sensor. I’m also seeing the same thing with a similar sensor I’ve set up for the latest Valetudo version on GitHub.
It seems the ‘latest’ link no longer loads a redirect message, but just an empty page, before redirecting. Running the curl command from a command line without the -s (silent) parameter, and without the ‘cut’ filter, now just produces an empty response. From memory, it used to show the redirect message.
The link itself obviously still redirects correctly in a web browser, but that’s not really the point surely? From my understanding, curl doesn’t redirect by default, and so just stays on the page with the redirect message, which is what we want - not the page it ends up on - so we can extract the latest version from the message using ‘cut’.
I wonder if you’re not seeing this yet due to some caching going on somewhere?
Explanations as far as I can see:
-L - follows the redirect
-I - only downloads the headers of the destination page, not the body - seems to cut down the text that the command returns
-s - curl works silently
-o - output → /dev/null - output result to null
-w - return the final url (which we need to work the cut magic on)
Because we are dealing with the url now, there’s no need to handle quotation marks or escape them, so we can drop the first cut action from the previous version.
Will see if this gets the sensor back up and running and report back.
EDIT: yep, seems to work fine for both the Tasmota and Valetudo sensors.
Did work for me untill HA update 2024.2.1.
Now the curl command stays active consuming lots of CPU.
Every 10 minutes the command will run again and it will start a new process consuming CPU.