A Home Assistant custom component that creates sensors based on the output of curl commands.
- Copy the
custom_components/mycurlfolder to your Home Assistantcustom_componentsdirectory. - Restart Home Assistant.
- Configure the integration in your
configuration.yaml.
- Create sensors that run curl commands and use their output as sensor values.
Add an entry like this to your configuration.yaml:
sensor:
- platform: mycurl
name: "Bitcoin Price"
curl_command: "curl -s https://api.coindesk.com/v1/bpi/currentprice/BTC.json | jq -r .bpi.USD.rate_float"
scan_interval: 300This will create a sensor that fetches the current Bitcoin price in USD every 5 minutes.
Note: You can use any curl command that outputs a value. Make sure any required tools (like jq) are installed on your Home Assistant system.
This repository is structured for HACS installation.
MIT