Are you using Home Assistant in your van?

oooh! and the ID in the sensor is the Cerbo's ID, not the HA ID....

I think we may be onto something here!
 
Not sure why you are doing this. Before you go any further, why the 'Mosquitto' file in share? Mosquitto doesn't save anything, it is just a man in the middle for passing messages to and from a central point (think Post Office Sorting Office - but a bit more efficient). Try this link. Also, not sure why the Teltonika Conf file as you are using HA.
 
I'm very much at the 'monkey see, monkey do' stage of copying stuff and trying to understand why things work (and why they don't)

I don't really know what the Mosquitto folder in share does other than house the victron.conf file.

It's all taken from the Smarty Van video which is a good 'follow along' guide, but it doesn't really explain what those .conf files are doing, however it does work....

 
Mosquito is just another MQTT broker isn’t it. I guess you can chain them together but my instinct would be it’s not really helping and probably confusing things. I think people do it to use mosquito as a debugger/viewer.

Do you have a diagram of all the brokers and clients you have - publish and subscribe with IP addresses of everything.
 
Do you have a diagram of all the brokers and clients you have - publish and subscribe with IP addresses of everything.
No, and I think I should probably factory reset everything and start over now that I understand it a bit better and document what I've done as you suggest.

There's a good chance that I've done something along the way that's created problems which will be hard to diagnose as I really didn't know what I was doing to start with!

Subscribers  do not see these advertisements

 
Multi MQTT Brokers can be confusing, and work against you as you don't know where messages are going. Rog NotJane has a good idea to see what you are doing.

With NR I normally run Mosquitto on the same server, RUTX has a MQTT server, Venus OS has MQTT server, they all do the same thing, but to simplify what goes where, in this case I only use Venus MQTT Server, as it was already loaded and I was running on a RPi Zero 2 W, not a device with a lot of 'spare room'!! KISS Keep in simple s****d, a maxim that has served me well over the last x years (more than I care can remember!).
 
Well, just for the learning experience I think I'm going to give REST Api a shot.

(I know, I know... :D)

Partly because it's interesting and new, and partly because I've got to the point where my frustration with modbus and MQTT is preventing me from seeing the wood for the trees.

I've got some good resources to have a look at and when all that fails I'll be able to come back to MQTT with a fresh pair of eyes!

Shame that I've still not managed to get any information from anyone who's succeeded in linking Teltonika and HA.

Found a few threads on the HA community forums asking the same question but only one person who posted a solution, which sadly no longer works with current versions of RUT-OS.

I feel like I'm trying to uncover some dark secret! However, if I succeed then I'm going to be shouting it from the rooftops for all the other people who've been down the same painful journey.

It's the only way to learn though, so I'm off to see my old pal the brick wall again.... :ROFLMAO:
 
Nothing wrong with REST, we built a large IoT platform with webhooks with are effectively REST. The issue you might face is network complexity, each REST API is different and you need to set it up individually.

To that end, MQTT should make things simpler to add new sources (i.e. sensors and devices) and sinks (e.g. HA or NodeRed or whatever). But, because MQTT doesn’t specify a format for the data, it’s (I think) a level lower than where people really need.

It’s a bit like plumbing that automatically connects itself but you don’t know if it’s going to deliver hot water, cold water or gravy.
 
My thought was to use REST API just for pulling the Teltonika data so I shouldn't need to learn more than one.

When I stand back and have a high level look at this I've actually achieved most of what I needed to.

Controlling the lights was where this all started, which was easily done using ESP-32 and WLED. In fact it was so easy that it lulled me into believing that this was all going to be really easy and I'd have it set up in a couple of days!!

For the rest of what I need to control in HA I'm pretty close. The fan will be next, but I have a good guide to work from on that, and may eventually end up buying a completely redesigned circuit board if the chap developing it decides to go down a commercial route.

I've got all the victron data coming in nicely and may add an inverter which I'd just want to have an 'on / off' switch for.

On the list of 'future possibles' for HA:
  • Afterburner for diesel heater so that can be controlled (possibly add temp sensor for auto triggering)
  • Tank level sensors (although these might be on the Bobil system - undecided)
  • CCTV / MDVR type thing
  • Gas/CO detection sensor that opens the fans on full and sounds an alarm (although I might not be fitting gas to the van, so...)
  • Voice control for lights / fans
  • Water flow sensor
  • Remote water / waste dump valve
 
The NR Flow uses the REST API - look at the msg.url in the node before the HTTP Request (not the Authorise one) in the flow I posted in the PM.

Good luck with whichever way you end up using. You will learn something and everyone is different and uses the solution most suited to them.

If you have questions I can answer I will do so!

Subscribers  do not see these advertisements

 
Thank you so much again CeeJay13.

I will look at MQTT again and see if I can get that working too.

Then I can hopefully compare that to the REST API method and decide which I prefer.

Impossible to know until you've tried both I guess :)
 
I have recently upgraded to an N305 it has 8 cores. You just need a 12v stabiliser to power it from the habitation battery.
I've been looking into adding Voice to HA and it's strongly suggested to go with something more powerful than a Pi in order to minimise lag.

Just found an N305 with 16GB RAM and 512GB NVME (plus integrated cooling fan) for £300. I'm contemplating the 1TB NVME variant for £330 as it's not a massive increase in cost and if I'm using a multi-camera system to record 24/7 then it will quickly eat into storage.

Sound about right price wise matbic?
 
Yes for voice (local not over internet) an N305 is recommended. That’s about the going rate - might shave £20/30 off on AliExpress if you catch a deal going through. It’s easy to upgrade RAM and NVME with these boxes.
 
Maybe interesting to people on this thread:


ESP32 Arduino code to “…receive, dissect, decrypt, decode and report the current device status and readings from the 'advertised data' that is continually transmitted over Bluetooth Low Energy (BLE) by the Victron device”
 
While I wait for my mini PC to arrive, I've spent some time looking at a couple of other HA options which I'm slowly cobbling together into some semblance of order.

Pulling data from Teltonika router (not my code for the avoidance of doubt):


and then using that data to inform the GeoLocator integration so that you can do things such as localised weather reports (I quite fancy trying that using an e Ink display....) and any other geo-dependent automations you want.


I used the SmartyVan method for pulling in all the Victron Data into HA but it's good to have a couple of options.

I've also gone with BatMon in HA to pull the Fogstar data in to HA directly (note that this 'steals' the bluetooth connectivity from the Fogstar App so it will no longer see the battery). I already have the (more accurate I think) data from Victron, but it allows a 'double check' but it also (theoretically as I haven't done it yet) allows for an automation for a 'parked up' scene.

My plan is to have relays which can selectively turn off devices which are not required while parked up (e.g. ESP32s that control the LED lights etc) but also allow the batteries to drain to something around 75% SOC and only turn charging back on when they drop below that but then turn charge back off at 75% to keep them at their optimal 'storage' state.

Subscribers  do not see these advertisements

 
It’s on the way…….just give it a bit more time and that’ll be us 🤣

IMG_4469.gif
 
When the motorcar was invented people were concerned because there wasn't the backup of the horse's intelligence in the whole driving equation.

There was also the 'red flag' act where a human had to walk in front of a car holding a red flag in order to limit the otherwise reckless speed of the new fangled demonic inventions. People even predicted that humans would lose the ability to walk....

Technology marches on regardless and we can either embrace it or fear it and shake sticks at it.

Some of it will be solutions looking for a problem (keyless entry is one of those in my mind) but some of it will be really useful.

Closing my fan or retracting a step automatically isn't really any different to 'modern' cars that turn your headlights off automatically when you remove the key. How many of us remember leaving the lights on accidentally and coming back to a flat battery?

We also used to have to wait for someone to come by and flag them down to jump start the car because we didn't have a mobile phone to call someone with or a NOCO boost in the glove box....
 
Well, just for the learning experience I think I'm going to give REST Api a shot.

(I know, I know... :D)

Partly because it's interesting and new, and partly because I've got to the point where my frustration with modbus and MQTT is preventing me from seeing the wood for the trees.

I've got some good resources to have a look at and when all that fails I'll be able to come back to MQTT with a fresh pair of eyes!

Shame that I've still not managed to get any information from anyone who's succeeded in linking Teltonika and HA.

Found a few threads on the HA community forums asking the same question but only one person who posted a solution, which sadly no longer works with current versions of RUT-OS.

I feel like I'm trying to uncover some dark secret! However, if I succeed then I'm going to be shouting it from the rooftops for all the other people who've been down the same painful journey.

It's the only way to learn though, so I'm off to see my old pal the brick wall again.... :ROFLMAO:
I will be back in UK late next week a then I will post some HA configuration for the Teltonika to get you going! I just don’t have a Teltonika unit with me at the moment.

BTW MQTT for me just adds unnecessary complexity so I avoid it. MQTT is fantastic when you are trying to connect to low power devices over slow low bandwidth unreliable connections (what it was designed for) - it’s a bit unnecessary inside a van. Some people use MQTT for everything- not me!
 
Thanks matbic - however the yaml from usbrit using REST is working pretty much perfectly for me with my Teltonika.

I've got a few tweaks to do, but it's 99% there.

MQTT doing it's thing with my Victron kit perfectly happily but REST has most certainly been the way forward with the router.
 
Technology marches on regardless and we can either embrace it or fear it and shake sticks at it.
I've (Actually Douglas Adams, not me) come up with a set of rules that describe our reactions to technologies:
1. Anything that is in the world when you’re born is normal and ordinary and is just a natural part of the way the world works.
2. Anything that's invented between when you’re fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it.
3. Anything invented after you're thirty-five is against the natural order of things.

Subscribers  do not see these advertisements

 
Maybe interesting to people on this thread:


ESP32 Arduino code to “…receive, dissect, decrypt, decode and report the current device status and readings from the 'advertised data' that is continually transmitted over Bluetooth Low Energy (BLE) by the Victron device”
Talking of KISS ...
FWIW ESPEasy now has a plugin which allows an ESP32 to read data from Victron devices.
My setup is used to monitor my MH when parked in the storage yard. I have a single ESP32 running EspEasy to monitor my batteries (Shunt) and solar (MPPT) and report to me over GSM/MQTT. Consumes about 400mA when awake but sleeps for 55 minutes every hour!
I have an RPi running NodeRed and Grafana at home so I can keep an eye on things.
Might be of interest to someone who does want the level of complexity covered in this thread :giggle:
 
I'm a great believer in KISS, however...



I haven't installed the lights yet, but they will have their own switches and they will be positioned where I want them and they will be fine. The MaxxAir fan (I plan to buy a second) however works perfectly if you press the button on it, but the (size of a breeze block) remote control doesn't work from the bed because, somewhat inexplicably, they made it IR and then hid the receiver up behind the cowl and then stuck the blackout blind over the top of it to add insult to injury....

I found a great tutorial and several hundred lines of code freely shared which will allow me to use an ESP32 with an IR transmitter which I can conceal inside the MaxxAir fan and connect to Home Assistant so that I can control it wirelessly (rather than with IR) from my phone. One less (two actually if I get a second fan) remote control and set of batteries to carry around / store / lose / swear at.

The LED lights are controlled (or will be) by an ESP32 running WLED which has an integration for Home Assistant - so it's no extra effort to add them.

I'm in the process of building up a Raspberry Pi5 + M2 hat and 256G NVMe as the 'onboard computer' which will be used to power the "TV" (I haven't had a TV licence in 15 years so this will be for Netflix and some YouTube) and to do other computer type tasks such as browsing Motorhome Fun etc.

Libre Office is installed so I can 'work from van'

That's the longer version of my increasingly poor attempt at KISS...

Of course that doesn't include my PiHole + Unbound recursive DNS server or my VenusOS Pi based CerboGX or my Homepod Mini or....

There are going to be quite a few computers and micro controllers in my van :D
Are you speaking in code?
 
Talking of KISS ...
FWIW ESPEasy now has a plugin which allows an ESP32 to read data from Victron devices.

ESPEasy has improved over the last year!

My setup is used to monitor my MH when parked in the storage yard. I have a single ESP32 running EspEasy to monitor my batteries (Shunt) and solar (MPPT) and report to me over GSM/MQTT. Consumes about 400mA when awake but sleeps for 55 minutes every hour!
400mA for an ESP32 seems high - when not using wi-fi/bluetooth modem I find ESP32 uses at most 20mA when awake. Then when modem is on up to 200mA. But I guess if you are sending loads of data over wi-fi it will go higher.

Also, the ESP32 wif-Fi has an option to control its power output - I think you could save quite a lot of power by reducing the power output of the WiFi.

I use ESPhome it has an option to reduce power output on wi-Fi (which defaults to the maximum) - it’s realy saves power by reducing it. In a van the distances are so short we don’t need full power.

I have attached a bit from the data sheet - you see you can reduce power consumption with lower POUT values - this data is for at test with data being transmitted 50% of the time. This is a lot of data! - I find with my normal 2-5% load on WiFi the power consumption is much lower than the values shown.

Not sure if you can do the same with ESPeasy.

It’s really interesting to hear about what you are doing with ESP32, node red etc!



IMG_5768.webp
 
ESPEasy has improved over the last year!


400mA for an ESP32 seems high - when not using wi-fi/bluetooth modem I find ESP32 uses at most 20mA when awake. Then when modem is on up to 200mA. But I guess if you are sending loads of data over wi-fi it will go higher.

Also, the ESP32 wif-Fi has an option to control its power output - I think you could save quite a lot of power by reducing the power output of the WiFi.

I use ESPhome it has an option to reduce power output on wi-Fi (which defaults to the maximum) - it’s realy saves power by reducing it. In a van the distances are so short we don’t need full power.

I have attached a bit from the data sheet - you see you can reduce power consumption with lower POUT values - this data is for at test with data being transmitted 50% of the time. This is a lot of data! - I find with my normal 2-5% load on WiFi the power consumption is much lower than the values shown.

Not sure if you can do the same with ESPeasy.

It’s really interesting to hear about what you are doing with ESP32, node red etc!



View attachment 1062560
Yes, I know ... Actually 400mA is peak current including powering the WiFi router. (I havent managed to attache a GSM module to the ESP so Im using a MiFi device which is thirsty !
 
All very interesting, especially for someone like me who worked in IT for about 40 years. However, I think the KISS (Keep It Simple Stupid) proponents have a point. My wife is always saying to me that I must write a manual for our van documenting all the additions and non-standard stuff. She is afraid that should anything happen to me she will be left with an over complicated, unusable, and unsaleable contraption! She has a point!

As a result I have tried to restrict most of the electronics to monitoring rather than active control, so I have a Reolink camera in the van which can be accessed remotely via the Internet so long as the van's router has a connection, either via Starlink or the backup USB tethered mobile phone which lives in the dash top cubby. I also have a Renogy Core One display which acts as a collector of data via BlueTooth from my other Renogy kit, including shunt and MPPT controller, and which can similarly be accessed over the Internet.

In my case I have limited active electronic controls. I use a couple of internet enabled Tapo devices to turn mains on and off, potentially on a schedule, to my separate starter battery and leisure battery mains chargers, but only for convenience as the van lives on the drive, so I could easily turn them on and off manually. The only other active control I have is via my tracker which can be controlled over the 4G phone network and has an output which I can use to remotely turn on my auto gearshift immobilising mod, but I also have a secret physical switch for this. The tracker option is useful should we be away from the van and I realise I have forgotten to arm this.

Still, for many of us our campers are also an outlet for our creative and technical skills, so it is great to hear what people are doing.

Subscribers  do not see these advertisements

 
I found a great tutorial and several hundred lines of code freely shared which will allow me to use an ESP32 with an IR transmitter which I can conceal inside the MaxxAir fan and connect to Home Assistant so that I can control it wirelessly (rather than with IR) from my phone. One less (two actually if I get a second fan) remote control and set of batteries to carry around / store / lose / swear at.

You mind sharing the link to the tutorial for this please?

I managed to get it kinda working ages ago but I couldn't work out the codes for the different motor speeds
See here
 
Are you speaking in code?
01010111 01100101 01101100 01101100 00101100 00100000 01110100 01101111 00100000 01110011 01101111 01101101 01100101 00100000 01110000 01100101 01101111 01110000 01101100 01100101 00100000 01001001 00100000 01110000 01110010 01101111 01100010 01100001 01100010 01101100 01111001 00100000 01100001 01101101 00100000 01110011 01110000 01100101 01100001 01101011 01101001 01101110 01100111 00100000 01101001 01101110 00100000 01100011 01101111 01100100 01100101 00101110 00100000 01001111 01110100 01101000 01100101 01110010 01110011 00101100 00100000 01101000 01101111 01110111 01100101 01110110 01100101 01110010 00100000 01110111 01101001 01101100 01101100 00100000 01110101 01101110 01100100 01100101 01110010 01110011 01110100 01100001 01101110 01100100 00100000 01100001 01101110 01100100 00100000 01101101 01101001 01100111 01101000 01110100 00100000 01100101 01110110 01100101 01101110 00100000 01110010 01100101 01110000 01101100 01111001 00100000 01110111 01101001 01110100 01101000 00100000 01110100 01101000 01100101 00100000 01110111 01101111 01110010 01100100 00100000 00100111 01110011 01110001 01110101 01101001 01110010 01110010 01100101 01101100 00100111 00100000 01110100 01101111 00100000 01110000 01110010 01101111 01110110 01100101 00100000 01110100 01101000 01100001 01110100 00100000 01110100 01101000 01100101 01111001 00100000 01101000 01100001 01110110 01100101 00100001
 
01010111 01100101 01101100 01101100 00101100 00100000 01110100 01101111 00100000 01110011 01101111 01101101 01100101 00100000 01110000 01100101 01101111 01110000 01101100 01100101 00100000 01001001 00100000 01110000 01110010 01101111 01100010 01100001 01100010 01101100 01111001 00100000 01100001 01101101 00100000 01110011 01110000 01100101 01100001 01101011 01101001 01101110 01100111 00100000 01101001 01101110 00100000 01100011 01101111 01100100 01100101 00101110 00100000 01001111 01110100 01101000 01100101 01110010 01110011 00101100 00100000 01101000 01101111 01110111 01100101 01110110 01100101 01110010 00100000 01110111 01101001 01101100 01101100 00100000 01110101 01101110 01100100 01100101 01110010 01110011 01110100 01100001 01101110 01100100 00100000 01100001 01101110 01100100 00100000 01101101 01101001 01100111 01101000 01110100 00100000 01100101 01110110 01100101 01101110 00100000 01110010 01100101 01110000 01101100 01111001 00100000 01110111 01101001 01110100 01101000 00100000 01110100 01101000 01100101 00100000 01110111 01101111 01110010 01100100 00100000 00100111 01110011 01110001 01110101 01101001 01110010 01110010 01100101 01101100 00100111 00100000 01110100 01101111 00100000 01110000 01110010 01101111 01110110 01100101 00100000 01110100 01101000 01100001 01110100 00100000 01110100 01101000 01100101 01111001 00100000 01101000 01100001 01110110 01100101 00100001
🐿️
 
Yes, I know ... Actually 400mA is peak current including powering the WiFi router. (I havent managed to attache a GSM module to the ESP so Im using a MiFi device which is thirsty !
Oh that explains it! All GSM modems are thirsty 0.4A including mi-fi router is very good.

I have used GSM modules on several projects they can at times pull 2A of their power lines so not going to be better than your mi-Fi

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