TCP commands for Ethernet relay

no, no idea, but do you care? :slight_smile: just send the same header
i think maybe the header is for other stuff , but not implemented for a light, maybe its just reserved stuff

seems afterall your codes were different

Indeed :slight_smile: now trying to figure out how to connect this with HA. A lot of using above, you tube and docs from HA. :blush:

I have posted my whole config… You don’t need Google anymore, you just need to change your commands…

Yes i see, i miss like basic stuff :wink: how to use python scripts and declare these to the GUI buttons shell_command Is that you have installed? :joy:

ah, well, those are standard integrations
for my lights/plugs, i use the template light and template switch buttons! those are gui :slight_smile:

those switches/lights, they call a shell command, thats your TCP call …



2 Likes

and at the end you will have this :

just 2 pages (screens) from my 10 pages/screens home assistant showing :slight_smile:

1 Like

Hi Fabio,

Nice GUI you have there.:+1:

I don’t get my bash script working, think it is a Hass.io thing … I run it as an image on a intel nuc and the shell commands are unavailable. I suppose mapping and setup is different on other environments than hass.io

I think it is an authorization problem to execute the script, because it is running under homeassistant and the user (me :smiley:) is not allowed to execute.

ERROR (SyncWorker_0) [homeassistant.components.command_line.sensor] Command failed: shell_command.dobissreceive-

How are you running home assistant?
Do you have any experience with this?

I am running HassOs on a esxi server…
Can you post your shell command? Should work

Hi,

I’ve been following this thread also for some months and thanks to the last posts or Fabio I’ve been able to continue with my configuration.
I was also struggling with the same error you mentioned and I just put the print of data1 and data2 as last command of the python script. I think the error message comes from the closing of the socket.
When reading the sensor I now have the output of the python script.

Thanks again for this elaborate explanation to both of you!

No problem, how did you configure the python to read the status? I am not a programmer at all, just a googler :wink: what’s wrong with my socket close?

ok, it seems it was not due to the switch of print and socket.close but because of how I configured it in my configuration file.
adding dobissreceive in the “shell command” section is not working
I added it as follows:

sensor:

  • platform: command_line
    name: prog
    command: “python3 /config/python_scripts/dobissreceive.py”
    scan_interval: 15

Like this I don’t have the error message and I have feedback in the sensor.
Maybe I did something wrong in the configuration/definition of the python script…

Ah, ok my code was correct then, it was just your shell command not firing… Here it works though, but I have now everything configured in the secrets file

If you like my theme, I am using this one , it’s almost the same: https://github.com/jimz011/homeassistant

Am I correct if the curl will not work if my connection is not https?
currently I only use HA on my internal network, with http, not https…

should work, but i dont think you need the -k option, that option is there to ignore the valid certficates

Where do I find the bearer?

in hassio, on your profile page, there you can create a long live token

Hi Fabio, could you display what you receive from print(data +’–’ + data2) pls.
many thanks.

at this moment, quite a lot 000 :slight_smile: everything is turned off

0000000000000000000000000000000001000000000000000000000000000000--0000000000000000000000000000000000000000ffffffff0000000000000000

so if I understand you good, with:

  • platform: template
    lights:
    bureau:
    friendly_name: “Bureau”
    value_template: “{{ states.sensor.dobiss.state[0:2] == ‘01’ }}”

you look to the first two decimals?

because, my output is different… but I do see the values from my universal input module