How to send $value from home asstistant entity

More
1 year 3 months ago - 1 year 3 months ago #6417 by SeByDocKy
Ok I found the solution. You don't have to use a shell_command since templating is not working (properly) but use a binary_sensor command line. So in your binary_sensors.yaml

########## radmon.org ########
- platform: command_line
  name: radmon_send_data
  command: 'curl -s "http://radmon.org/radmon.php?function=submit&user=xxxxx&password=yyyyy&unit=CPM&value={{(states.sensor.your_CPM_entity.state|int)}}"'
  payload_on: 'OK<br>'
  scan_interval: 60
Last edit: 1 year 3 months ago by SeByDocKy.

Please Log in or Create an account to join the conversation.

More
1 year 1 month ago - 1 year 1 month ago #6472 by SeByDocKy
HA is going to change how to define a command_line binary sensor. Now in your configuration.yaml
command_line: 
   - binary_sensor:
       name: radmon_send_data
       command: 'curl -s "http://radmon.org/radmon.php?function=submit&user=xxxxxx&password=yyyyy&unit=CPM&value={{(states.sensor.yourCPMsensor.state)}}"'
       payload_on: 'OK<br>'
       scan_interval: 60



 
Last edit: 1 year 1 month ago by SeByDocKy.

Please Log in or Create an account to join the conversation.

More
1 year 4 days ago - 1 year 4 days ago #6550 by cougar
Hi,

I just integrated my ESPhome Geiger counter with radmon.org. There is RESTful Sensor that can be used for that which is somewhat more secure than using command. For me it is just easier to read in config. Put something like this into the configuration.yaml or any package file:
sensor: 
   - platform: rest
     unique_id: "798adf5b-bfd9-4bd6-a09d-e5c1f8fff518"
     name: "radmon"
     scan_interval: 60
     resource: http://radmon.org/radmon.php
     params:
       function: 'submit'
       user: 'xxxxxxxx'
       password: 'XXXXXXXX'
       unit: 'CPM'
       value : "{{ states('sensor.geiger_counts_per_minute')|int(0) }}"
Last edit: 1 year 4 days ago by cougar.
The following user(s) said Thank You: steadramon

Please Log in or Create an account to join the conversation.

More
11 months 3 weeks ago #6556 by SeByDocKy
I tried a pure ESPhome solution.... (via http_request.get) but I find this solution not super stable (the ESP32 rebooting every 15min)

Please Log in or Create an account to join the conversation.

More
3 months 3 weeks ago - 3 months 3 weeks ago #6914 by OH8EFI
This will run in ESP locally? I tried http_request but the ESP reboots every time it tried it. I was able to http_request.send POST to GMCmap and it works fine. What should I use as an unique identifier?
EDIT: Got the http_request working
Last edit: 3 months 3 weeks ago by OH8EFI.

Please Log in or Create an account to join the conversation.

Moderators: Gamma-Man
Time to create page: 0.246 seconds
Powered by Kunena Forum
Everything's free. Please support us by considering a donation. Log in first!
Solar powered Raspberry Pi 4 server stats: CPU 34% Memory 13% Swap 14% CPU temp=60.8'C Uptime 36 Days