I’m totally new to Home assistant and trying to figure out how to publish my temperature sensors to my website. I used to do this from Domotiz using a PHP script and parse the JSON values easly.
However, i don’t understand the HA API …
Searched the forum but everything is about geting values INTO Home assistant.
Hi,
if you can make a REST call from php, you can use something like this, the response is in JSON format: http://<home-assistant-ip>:8123/api/states/<entity-id>
Besides you need an Access token which you can create at profile page from HA. Here is an example call from Firefox REST Plugin:
hi, I want to ask, is the PHP get code above used to get the sensor value?, I tried it through local visual studio. But, I still can’t get the value out, I’ve changed the URL path, but it still doesn’t work. Is there a solution?, thanks in advance
You are querying HA not the device.
And you are doing that inside your local LAN so your masking makes no difference. It only makes it harder to help you.
Are you sure you have SSL set up in your local LAN? Shouldn’t the URL be http?
hi sorry for late response, my home assistant uses https because it uses duckdns so the url should be correct using https and I’ve added it to configuration.yaml on home assistant visual studio not local (which is on ha) ssl_certificate and ssl_key