Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95445

RESTful sensor json help

$
0
0

@peterosullivan wrote:

New to home assistant!

Having read the doc’s I’m trying to get tidal information from the URL below, using the rest platform. But I cant even get the current_time returned. The Developer Tool -> States for sensor.rest_tide unknown.

Here’s the returned json from http://www.bom.gov.au/australia/tides/scripts/getNextTides.php?aac=VIC_TP020&offset=false&tz=Australia%2FMelbourne

{ "results": { "current_time": 1574317137, "next_high": { "time": 1574322960, "height": 2.23 }, "next_low": { "time": 1574343480, "height": 0.55 } } }

I think the problem might be that the URL is returning HTML even though it looks like JSON.

sensor:
  - platform: rest
    resource: http://www.bom.gov.au/australia/tides/scripts/getNextTides.php?aac=VIC_TP020&offset=false&tz=Australia%2FMelbourne
    name: rest tide
    scan_interval: 30
    value_template: '{{ value_json.results.current_time }}'

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95445

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>