Are you using Home Assistant in your van?

In the automation editor you will find the action you require under “home assistant supervisor” in the “other” category.
Ah! I found a nice button script from Juan Diego Tórtul in the HA community forum

type: button
tap_action:
action: call-service
confirmation:
text: confirm HA shutdown
service: hassio.host_shutdown
service_data: {}
target: {}
show_state: false
show_icon: true
name: Apagar sistema
icon: mdi:power
hold_action:
action: none
icon_height: 30px
 
dpsuk999 what sensor have you put in the fridge to get temp and humidity?

Also, do you use that data in any automations or is it just for info?
 
Surely not a physical off switch? :)
Good grief! No!

That just won't do!

:D

(there will be one for 'power off' - I'm thinking one of those massive industrial ones with the handle you pull down....)

f84c4863a65912e6bcb8876d813682f0.jpg
 
I think this is where I will end up eventually. For the moment the Pi is fine for doing the learning. It won't be difficult to repurpose it for something later!
Very sensible - all you have to do to move HA from one server to the next is do an unencrypted backup - easy with the command line tools:

ha backups new --uncompressed --name xxx.tar
Then restore on to new server. Never let me down - yet!

I haven't started with the voice stuff yet (I know it's a big thing in HA at the moment) but if I can get at least the main functions done with voice control then that would be epic!
Yes the really great thing about the way HA is doing voice control is that it does not need an Internet connection so is much more practical in a van.

However, if you want a quick and easy way to do voice control you can set up Apple Siri with the Home Assistant iOS App. Have a look at: https://companion.home-assistant.io/docs/integrations/siri-shortcuts/

I think the same sort of thing is possible with Google stuff.
 
dpsuk999 what sensor have you put in the fridge to get temp and humidity?

Also, do you use that data in any automations or is it just for info?
If it helps I use the “RuuviTag Pro” it is easy to set up in HA and can also be read by Victron (not useful for me l, but would be if my HA server did not have Bluetooth then I could read it via the victron)

I have a nice graph showing when the fridge/freezer is in the “safe” zone. Also HA sends a push messsge to my iPhone if either get too cold or hot. It’s saved my lettuce a few times!

I am planning to dismantle my fridge and get control of it so I can control the temperature from HA - my dear wife thinks I might break it - so this will have to be a stealth project in the winter!

If only my fridge switched on when the power was applied - then I would not need to dismantle it!

Subscribers  do not see these advertisements

 
Sorry, been fighting the Teltonika Curl - Node-RED HTTP request for Authentication. Curl works fine.
curl -X POST "https://<DEVICE_IP>/api/login" -H "Content-Type: applisimilar to thiscation/json" -d '{"username": "<username>", "password": "<password>"}' -k

But there is a problem with the TeltonikaCertificate which causes this...
SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.

Add -v to the end of the Curl command and you get a verbose response to the Curl request.

At the moment using VenusOS MQTT server, seems to be stable. The Node-RED, Pi-Hole, InfluxDB and Grafana are all running on a £15 server Dell Wyse 30340 N10D Thin Client with Power Supply (similar to this) - Diet Pi runs fine on it!!

I will try Virtual machines later, but the N10 has been run with a lot more and has been monitored at 4W Consumption. Luckily, mine is a 12V version and so easy to power from my stabalised 12V.
 
This site contains affiliate links for which MHF may be compensated.
Yeah - I made a start on trying the Teltonika via API using:



curl -X POST "https://router IP/api/login" \
-H "Content-Type: application/json" \
-d '{"username": "username", "password": "password"}’ \
-k

This should generate your token which you then use in the following:


curl -X GET "https://11.11.11.1/api/system/device/status" \
-H "Content-Type: application/json" \
-k

Although this also failed so....

..I'll revisit it later.
 
I can get things to work with Curl, but I am trying to get it working from Node-RED, once I get that going, I should be OK. Put a post in their Forum asking for help. There are some really knowledgeable people over there!
 
If it helps I use the “RuuviTag Pro” it is easy to set up in HA and can also be read by Victron (not useful for me l, but would be if my HA server did not have Bluetooth then I could read it via the victron)
It does. I used to work at an IoT startup and we used Ruuvi tags. I just checked our main supplier: Disruptive Technologies now have a 5v gateway. Their sensors would be so good in vans! Their temp and humidity is smaller than a scrabble tile and has ~10y of battery life if you sample infrequently. I put some in this van for a while but the old gateway needs PoE or 240v.

There isn’t a HA integration but they have a simple web hook so integration would be simples - would depend on having network to your HA server though

Subscribers  do not see these advertisements

 
It does. I used to work at an IoT startup and we used Ruuvi tags. I just checked our main supplier: Disruptive Technologies now have a 5v gateway. Their sensors would be so good in vans! Their temp and humidity is smaller than a scrabble tile and has ~10y of battery life if you sample infrequently. I put some in this van for a while but the old gateway needs PoE or 240v.

There isn’t a HA integration but they have a simple web hook so integration would be simples - would depend on having network to your HA server though
Interesting thanks for the heads up, they look very small and neat.

I like the Ruuvi as the Bluetooth is already on board the RasPi so no need for a gateway. They are much larger than your suggestion - looks like batteries in the freezer are going to last about a year and it sends a reading every 10-20secs.
 
I was under the impression that the RasPi had pretty unreliable Bluetooth drivers? So much so that people use an external ESP as a relay.
 
I was under the impression that the RasPi had pretty unreliable Bluetooth drivers? So much so that people use an external ESP as a relay.
I don’t have any problem with the Raspi Bluetooth as it’s a very short distance to the sensors in my van.

The ESPhome Bluetooth relay is great when the range is too great I use them in my house.

When I take my fridge to bits to get control of it I will hardwire some temp sensors in it and use an ESP32 board to control the temperature accurately.

In the meantime the Bluetooth tags are a good quick fix.
 
dpsuk999 - can I ask what method you used to get the data from the Teltonika into HA?

I've hit a brick wall with this one.

I'm starting to look at Node-Red in the meantime as it's something I don't know anything about.

Subscribers  do not see these advertisements

 
I'm starting to look at Node-Red in the meantime as it's something I don't know anything about.
I have got this far, seems one of my nodes, with all the messing about, didn't want to work as intended. I am now having trouble with getting the Bearer Token input to get the position, but this is what I have so far.
Code:
[{"id":"ece0f503b47ecf67","type":"debug","z":"c17afc2be7cc5e34","name":"Auth token","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":490,"y":120,"wires":[]},{"id":"8692a674ec486a3f","type":"http request","z":"c17afc2be7cc5e34","name":"Authorise","method":"POST","ret":"txt","paytoqs":"ignore","url":"https://<ROUTERIP>/api/login","tls":"83319386ef1552b4","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"Content-Type","keyValue":"","valueType":"other","valueValue":"application/json"}],"x":320,"y":120,"wires":[["ece0f503b47ecf67","b6b737382cb7e14d"]]},{"id":"991c8515cce0cbbc","type":"function","z":"c17afc2be7cc5e34","name":"Get Pos","func":"const token = msg.payload.data.token\nmsg.payload = \"\"\nlet bearer = \"Bearer \" + token\nflow.set(\"bearer\", bearer)\nmsg.headers = {\n   \"Authorization\": flow.get(\"bearer\"),\n   \"Content-Type\": \"application/json\"\n}\nmsg.url = \"https://<ROUTERIP>/api/gps/location/status\"\nreturn msg; ","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":320,"y":160,"wires":[["d0b24fcbeae9b268","a4ac934fa1e1a917"]]},{"id":"d0b24fcbeae9b268","type":"debug","z":"c17afc2be7cc5e34","name":"Pos setup","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":340,"y":200,"wires":[]},{"id":"b6b737382cb7e14d","type":"json","z":"c17afc2be7cc5e34","name":"","property":"payload","action":"","pretty":false,"x":190,"y":160,"wires":[["991c8515cce0cbbc"]]},{"id":"a4ac934fa1e1a917","type":"http request","z":"c17afc2be7cc5e34","name":"GPS Status","method":"GET","ret":"txt","paytoqs":"ignore","url":"","tls":"83319386ef1552b4","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"Content-Type","keyValue":"","valueType":"other","valueValue":"application/json"},{"keyType":"other","keyValue":"Authorization","valueType":"other","valueValue":"Bearer .$${{msg.bearer}}"}],"x":490,"y":160,"wires":[["fbef3e448ad4c6ac"]]},{"id":"fbef3e448ad4c6ac","type":"debug","z":"c17afc2be7cc5e34","name":"Position","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":540,"y":200,"wires":[]},{"id":"33e2758c1ec1e926","type":"inject","z":"c17afc2be7cc5e34","name":"Authorise","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":"6","topic":"","payload":"{\"username\":\"admin\",\"password\":\"<PASSWORD>\"}","payloadType":"json","x":160,"y":120,"wires":[["8692a674ec486a3f"]]},{"id":"83319386ef1552b4","type":"tls-config","name":"","cert":"","key":"","ca":"","certname":"","keyname":"","caname":"","servername":"","verifyservercert":false,"alpnprotocol":""}]
Once you have the position, you can output to MQTT and then get HA to get the message (Don't know how HA works with Node-RED installed - never used it).
 
Thanks CeeJay13

It seems like the universe doesn't want me to get my hands on this code :ROFLMAO:

Screenshot-2025-05-01-at-13-54-02.png


Oddly though, I can see the stuff you formatted using the CODE tags in post #67.

I did try to post my code examples with the tags but it came up with the same permissions error so I removed the tags.
 
Don't know how HA works with Node-RED installed - never used it)

On the face of it, it sounds pretty straight forward, but then MQTT sounded quite straight forward when I first started trying this a couple of months back!

It's just another thing to wrap my brain around, but I guess that's partly why I'm doing all of this stuff anyway so I may just take a quick abseil down that rabbit hole too....
 
On the face of it, it sounds pretty straight forward, but then MQTT sounded quite straight forward when I first started trying this a couple of months back!

It's just another thing to wrap my brain around, but I guess that's partly why I'm doing all of this stuff anyway so I may just take a quick abseil down that rabbit hole too....
If you 'Reply' to the post, it all magically appears in the reply box. I wonder if Jim has some kind of protection in case of malicious code.
 
Can't edit the post with my nearly complete code in, for the record, here is the working Node-RED flow to fetch /api/gps/position/status.

Code:
[{"id":"792562e89c264fd8","type":"debug","z":"c17afc2be7cc5e34","name":"Auth token","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":530,"y":120,"wires":[]},{"id":"b516c6cdee97d1a0","type":"http request","z":"c17afc2be7cc5e34","name":"Authorise","method":"POST","ret":"txt","paytoqs":"ignore","url":"https://<ROUTERIP>/api/login","tls":"83319386ef1552b4","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"Content-Type","keyValue":"","valueType":"other","valueValue":"application/json"}],"x":360,"y":120,"wires":[["792562e89c264fd8","15b2fe07b27b1351"]]},{"id":"1c220b6add40b080","type":"function","z":"c17afc2be7cc5e34","name":"function 7","func":"const token = msg.payload.data.token\nmsg.payload = \"\"\nlet bearer = \"Bearer \" + token\nflow.set(\"bearer\", bearer)\nmsg.headers = {\n   \"Content-Type\": \"application/json\",\n   \"Authorization\": flow.get(\"bearer\")\n}\nmsg.url = \"https://<ROUTERIP>/api/gps/position/status\"\nreturn msg; ","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":160,"wires":[["843cfc1b6735a182","7e4ee618db23af8e"]]},{"id":"843cfc1b6735a182","type":"debug","z":"c17afc2be7cc5e34","name":"Pos setup","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":380,"y":200,"wires":[]},{"id":"15b2fe07b27b1351","type":"json","z":"c17afc2be7cc5e34","name":"","property":"payload","action":"","pretty":false,"x":230,"y":160,"wires":[["1c220b6add40b080"]]},{"id":"7e4ee618db23af8e","type":"http request","z":"c17afc2be7cc5e34","name":"GPS Status","method":"GET","ret":"txt","paytoqs":"ignore","url":"","tls":"83319386ef1552b4","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":530,"y":160,"wires":[["8b6d3fd3ecee7376"]]},{"id":"8b6d3fd3ecee7376","type":"debug","z":"c17afc2be7cc5e34","name":"Position","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":580,"y":200,"wires":[]},{"id":"40b9dccbcf5e2da5","type":"inject","z":"c17afc2be7cc5e34","name":"Authorise","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":"6","topic":"","payload":"{\"username\":\"admin\",\"password\":\"<PASSWORD\"}","payloadType":"json","x":200,"y":120,"wires":[["b516c6cdee97d1a0"]]},{"id":"83319386ef1552b4","type":"tls-config","name":"","cert":"","key":"","ca":"","certname":"","keyname":"","caname":"","servername":"","verifyservercert":false,"alpnprotocol":""}]

Subscribers  do not see these advertisements

 
Just out of curiosity matbic - what N100 are you using?
I have a small 12v mini-pc I found on AliExpress - just search for “12v mini-pc” there are so many to chose from. The Intel N97 or N100 are 4 cores so happily run proxmox. I have recently upgraded to an N305 it has 8 cores. You just need a 12v stabiliser to power it from the habitation battery.

There is lots you can fiddle with in the bios to limit power consumption.

This was a helpful guide: https://www.cnx-software.com/2024/0...s-n100-vs-core-i3-n305-benchmarks-comparison/

This is a well written guide on installing HA on proxmox : https://www.derekseaman.com/2023/10/home-assistant-proxmox-ve-8-0-quick-start-guide-2.html
 
Thanks CeeJay13 - Found the secret way to read the hidden code!

Jim, is this due to some change in the forum software? The code from the earlier post shows fine so I'm thinking something must have been tweaked somewhere?

matbic - thank you! I've been having a little look around at them and the power consumption does start to add up if I setup several Pi's v an N100. I run all my computer stuff including the router on a stabilised 12v supply (learned that the hard way!)

I really like the idea of having it all in a single unit as it also makes cabling and power much more straight forward.
 
matbic - thank you! I've been having a little look around at them and the power consumption does start to add up if I setup several Pi's v an N100. I run all my computer stuff including the router on a stabilised 12v supply (learned that the hard way!)

I really like the idea of having it all in a single unit as it also makes cabling and power much more straight forward.
Exactly!

But it’s better than that! Proxmox allows you over allocate your processors ie. you assign more processors than you actually have to all your virtual machines. They all still run and it only slows down if you are running everything all at once - which is unusual. So rather than having lots of small computers on all the time mostly at idle wasting power for nothing - you have one busy one shared out amongst all you virtual ones. It works out overall to be much more efficient of power.

Plus the admin is so much easier - snapshots let you try things out and then go back if they don’t work out.

For the brave you can install proxmox on a raspi and then have raspi virtual machines - but I have used proxmox on Intel for years and HA runs beautifully on it so don’t need a real raspi at all now.

Proxmox is super useful I have a windows 11 VM a couple of Linux desktops, media server, HA and a pfsense router all running happily on a little mini-pc.
 
but then MQTT sounded quite straight forward when I first started trying this a couple of months back!
The problem with MQTT is that it doesn’t define a format on the wire, it just passes whatever message you give it so, in those messages there is plenty vendor specific complexity.
 
I didn't even get that far with just MQTT :D

The results I'm getting from the Modbus TCP and the Data to Server setup in RUT-OS are encouraging.

Screenshot-2025-05-01-at-21-22-39.png


However, I don't know how to pick that up from HA. That's me logging MQTT Explorer into the router directly (11.11.11.1)

For my Victron stuff I created (copied!) a sensor

vicMQTT.png


and that worked perfectly, so I tried the same with Teltonika

TelMQTT.png


But sadly that comes up with an unknown value in HA which isn't surprising because if I point MQTT Explorer at HA (11.11.11.150) then there's nothing showing for Teltonika.

HAExp.png


I did have a 'keep alive' automation for the Victron stuff (again copied but working) which simply publishes an empty payload to the topic every 30 seconds and I tried doing the same for Teltonika. Of course this creates the 'teltonika/temperature' topic in MQTT on HA but, of course, it's not talking to the router so it's simply an empty payload.

What I hadn't thought to do was to search for people who've integrated OpenWRT into HA because RUT-OS is just a fork of OpenWRT....

I can't believe I've only just through to try searching for that... :doh:

Subscribers  do not see these advertisements

 
Is the Teltonika correctly configured as an MQTT publisher? If so have you confirmed that it’s actually publishing? I don’t have one (yet) so I’m not sure what logging you can get out of it.
 
'correctly' configured?

Possibly not.

I went to Teltonika support who ran through my logs and then pointed me down the Modbus route - so I'm not entirely convinced that even they know how to get MQTT working properly :ROFLMAO:

There's not much to configure in the Publisher / Broker.

Publisher
publisher.png



Broker
broker.png


Then there's the bridge which I posted earlier where the MQTT topics are specified.

I've tweaked and played around with as much of that as I know how to, but never managed to get it to publish (or if it published, I never managed to pick it up)

That's why I was encouraged by the Modbus route, because I can see that data in MQTT Explorer. I just don't know how to get HA to see it yet....


dpsuk999 is the only person I've found that seems to have managed this successfully.

Would be fantastic to know if I'm even barking up the right tree or if I need to look at something like pulling the data via REST instead.

The problem is it's all new to me and all of this could be down to my HA sensor not having the right path, or missing a quotation mark or.... It could just be something really simple and stupid, but I don't know what I'm looking at!

My suspicions currently are that I need to specify to HA which host it needs to be listening to in order to receive the topic.

I suspect I'm missing a prefix in the path on the HA sensor and that "teltonika/temperature" is only the last part of it.

I'll get there eventually!
 
Last edited:
If you are going to install Venus OS, it has a MQTT Broker in it, enable it and it just works. It is effectively a 'man in the middle' accepting messages and then passing them along unchanged. If I understand correctly HA can pick up MQTT messages and process from there.
 
It is effectively a 'man in the middle' accepting messages and then passing them along unchanged.
I have yet to meet a man that either doesn't embellish or doesn't diminish messages! 😄

Seriously though I don't pretend to understand a fair bit of the actual technical terms etc but get the drift of what's being discussed which is interesting.
 
Thanks for your continued interest in my troubles and suggestions to help CeeJay13 - I really do appreciate it.

I do have a VenusOS install and have already enabled all three MQTT options in order to allow the Victron integration to work (Modbus TCP, MQTT (SSL) and MQTT (Plaintext).

The other thing I've done but failed to mention (because I forgot I did it but your questions are prompting me to go and double check everything which can only be a good thing) is to create a 'mosquitto' folder in the 'share' dir.

There's a 'victron.conf' file in there which contains the following code:

connection victron
address [your cerbo ip address]:1883
topic N/# in 0 victron/
topic R/# out 0 victron/
topic W/# out 0 victron/


Not knowing any better, and having had that working, I simply made another identical file called 'teltonika.conf' in the same dir and crossed the word 'victron' out and wrote the word 'teltonika' in in crayon instead (sorry, Monty Python reference!)

However, I'd put in the wrong IP address and my current testing rig is in the house which doesn't have the VenusOS connected to it - so I'll try moving everything back in the van later and see if that works....

Subscribers  do not see these advertisements

 

Join us or log in to post a reply.

To join in you must be a member of MotorhomeFun

Join MotorhomeFun

Join us, it quick and easy!

Log in

Already a member? Log in here.

Latest journal entries

Back
Top