Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command Line YAML configuration has moved #38

Open
bart1604 opened this issue Jun 13, 2023 · 3 comments
Open

Command Line YAML configuration has moved #38

bart1604 opened this issue Jun 13, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@bart1604
Copy link

Please fix this:

1

@Voxxie
Copy link

Voxxie commented Jun 15, 2023

Hi @bart1604,

I changed it to:

command_line:
  - sensor:
      name: Neerslag_Buienalarm_Regen_Data
      command: python3 -c "import requests; import json; import random; dataRequest = requests.get('https://cdn-secure.buienalarm.nl/api/3.4/forecast.php?lat=<lat-2-decimals>&lon=<lon-2-decimals>&region=nl&unit=mm%2Fu&c='+str(random.randint(0,999999999999999)) ).text; dataRequest = dataRequest.replace('\r\n',' '); data = '{\"data\":'+dataRequest+'}';    print(data);"
      json_attributes:
      - data
      value_template: "last_changed: {{states.sensor.neerslag_buienalarm_regen_data.last_changed}}"
      scan_interval: 240  
   - sensor:
      name: Neerslag_Buienradar_Regen_Data
      command: python3 -c "import requests; import json; import random; dataRequest = requests.get('https://gpsgadget.buienradar.nl/data/raintext?lat=<lat-2-decimals>&lon=<lon-2-decimals>&c='+str(random.randint(0,999999999999999)) ).text; dataRequest = dataRequest.replace('\r\n',' '); data = '{\"data\":\"'+dataRequest+'\"}';    print(data);"
      json_attributes:
      - data
      value_template: "last_changed: {{states.sensor.neerslag_buienradar_regen_data.last_changed}}"
      scan_interval: 240 
  • Replace <lat-2-decimals> with your latitude. For example: 55.00
  • Replace <lon-2-decimals> with your longitude. For example: 5.00

@bart1604
Copy link
Author

Great! will do the same.

Thanks for the reply.

Now only the installation guide needs to be editted.

@huizebruin
Copy link

huizebruin commented Aug 23, 2023

And the other for home zone .

command_line:
  - sensor:
      name: Neerslag_Buienalarm_Regen_Data
      command: python3 -c "import requests; import json; import random; dataRequest = requests.get('https://cdn-secure.buienalarm.nl/api/3.4/forecast.php?lat={{state_attr("zone.home", "latitude") | round(3, default="not available")}}&lon={{state_attr("zone.home", "longitude") | round(3, default="not available")}}&region=nl&unit=mm%2Fu&c='+str(random.randint(0,999999999999999)) ).text; dataRequest = dataRequest.replace('\r\n',' '); data = '{\"data\":'+dataRequest+'}';    print(data);"
      json_attributes:
      - data
      value_template: "last_changed: {{states.sensor.neerslag_buienalarm_regen_data.last_changed}}"
      scan_interval: 240  
  - sensor:
      name: Neerslag_Buienradar_Regen_Data
      command: python3 -c "import requests; import json; import random; dataRequest = requests.get('https://gpsgadget.buienradar.nl/data/raintext?lat={{state_attr("zone.home", "latitude") | round(2, default="not available")}}&lon={{state_attr("zone.home", "longitude") | round(2, default="not available")}}&c='+str(random.randint(0,999999999999999)) ).text; dataRequest = dataRequest.replace('\r\n',' '); data = '{\"data\":\"'+dataRequest+'\"}';    print(data);"
      json_attributes:
      - data
      value_template: "last_changed: {{states.sensor.neerslag_buienradar_regen_data.last_changed}}"
      scan_interval: 240 

And i did make a pull request for the update to the readme file.
#40

@aex351 aex351 added the bug Something isn't working label Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants