EBus: waterpressure not available unless manual request by ebusctl

Hi, I’m running ebus as HA-add-on and it works great with sending a lot of values to HA MQTT.
But I was missing an entity regarding water pressure, so I recongnized the following:

  • By default, around 400 Entities have been created
  • “waterpressure” was not a part of this and also on MQTT I could not receive any messages about this topic
  • After setting up Advanced SSL, I was able to use “ebusctl r -f waterpressure” and surprisingly received a value on Terminal:
    image
  • on MQTT I immediately received a message, containing the information from terminal:

Is it possible to automate these steps and add the current water-pressure to an entity to supervise it?

Thanks a lot in advance!
Nik

Ebusd can be very tricky to troubleshoot as it has many variabiles ( docker vs local install, local csv vs. Dowloaded config etc…)

My first try would be to set the polling frequence of that message ( r1,… or r2,… at the start of that line in the csv config file).

Another option could be to schedule the command via os cron or equivalent.

Another one could be using HA aitomation to run at scheduled time a shell script (shell_command)…

Hope it helps

Also note that even if MQTT get the message is not straightforward that the same message get sent to HA via autodiscovery.
Some messages don’t get mapped via mqtt-hassio.cfg and thus require that you implement an mqtt sensor in HA to subscribe to that topic.

1 Like

Thanks for your replies on this!

An MQTT sensor shouldn’t be an issue; your upper reply regarding ebusd scares me a little bit :see_no_evil:
The configs I receive from the official repo but I like the idea of scheduling to run a shell script; every 30 minutes would be sufficient. But I have no experience about scripting in HA, last time I did scripting was using Batch to deploy some SW on WinXP…

Okay, got it set up (I think):

alias: "Heizung: Wasserdruck übermitteln"
description: ""
trigger:
  - platform: time_pattern
    hours: "1"
condition: []
action:
  - service: shell_command.enter_ebus_docker
    data: {}
  - service: shell_command.get_water_pressure
    data: {}
mode: single

The commands are defined as follows:

#Shell Commands
shell_command:
  enter_ebus_docker: docker exec -it `docker ps | grep ebusd | awk '{print $1}'` /bin/bash
  get_water_pressure: ebusctl r -f waterpressure

When testing, I do not get anything… :smile:
Any idea where I do wrong?

Thanks, Nik

I’m not a shell script guru either but I think it fails because as it’s configured now the second command is not executed because it must be run inside the docker, an thus in a different shell from the one where HA can “reach”.
Try to put both commands on the same shell_command, like this:

docker exec -it `docker ps | grep ebusd | awk '{print $1}'` ebusctl r -f waterpressure

And try to see if the MQTT message is generated.

Unfortunately not :frowning:

When I use your command on Terminal it works, from Automation it seems to do nothing: No Log entries, no return…

Oh, using DevTools running the service I’m getting the following:

Try changjng the command with something to run on the hassio server like a touch to create a file…so you ca check if it’s executed.

Okay, I think I understood what you were talking about:

I created a second shell command “touch find_me.txt” which created the file.
Within Terminal I searched for it and it was found:

➜  ~ find / -name find_me.txt
/homeassistant/find_me.txt

However, when I run the command from “homeassistant”-folder in Terminal, it works:

➜  ~ cd homeassistant 
➜  homeassistant docker exec -it `docker ps | grep ebusd | awk '{print $1}'` ebusctl r -f waterpressure
0.672;ok

From Automation it still doesn’t…

I’d go for a crontab entry. Quick&dirty.

crontab -e and add the line.

Only drawback that i see is that if you change or reinstall ha server you’ll lose the scheduling and you’ll need to do it again

I really tried to but still without success:
1.) Edited file like this and saved it (:wq)

2.) Since nothing happened within the upcoming minutes, I rebooted the entire system (is there a way just to restart the scheduled jobs?) and the entry got lost; file looked again like this:

Sorry I’m no expert on hassio or wathever. I have a standard x86 server with docker on top.
I’m now thinking that ha in some way pilot the crontab … sorry to have misled you

No worries! I’m so glad about your help!!!

I’m wondering what’s inside the within mentioned scripts, will have a closer look later today, maybe I can add my command there