REST question

Lol Ok Ill give that a go. I thought I attempted that and HA threw a fit, but maybe not.

Run your yaml file through Yaml Lint. It will clean up your indents.

I believe I fixed the formatting, but I might need someone to yell at me some more. I am still getting a TTS “Unkown” reading. I am not sure what IP and port go in the shell_commands.yaml or is this for a magic mirror or a display of some sort?.

Script yaml

bg_tts_alarm:
  alias: BG TTS Alarm
  sequence: 
  - service: media_player.volume_set
    data_template:
      entity_id: 
      - media_player.josh_and_caila_mini
      - media_player.coral
      - media_player.xbox_mini
      volume_level: '.50'
  - service: tts.google_say
    entity_id: media_player.josh_and_caila_mini
    entity_id: media_player.coral
    entity_id: media_player.xbox_mini
    data_template:
      message: "Wake up. Mom blood sugar is {{states('sensor.json_sgv')}}."

bg_tts_current:
  alias: BG TTS Current
  sequence:
  - service: tts.google_say
    entity_id: 
    - media_player.josh_and_caila_mini
    - media_player.coral
    - media_player.xbox_mini
    data_template:
      message: "{{states('sensor.json_sgv')}}."

monitoron_mirror:
  alias: Mirror Monitor On
  sequence:
  - service: shell_command.monitoron_mirror

Config yaml

sensor:
  - platform: rest
    name: JSON_sgv
    resource: https://private.herokuapp.com/api/v1/entries/current.json
    value_template: '{{ value_json[0].sgv }}'

shell yaml

monitoron_mirror: curl -s http://192.168.1.42:9411/remote?action=MONITORON

what is the result of the following:

curl https://private.herokuapp.com/api/v1/entries/current.json

What is the state of the rest sensor?

I am not sure how to do the curl command, do i just put that line in the shell_command.yaml file?

I am not seeing the sensor in my entity list. I am assuming it would be called JSON sgv.

Without the curl.
https://private.herokuapp.com/api/v1/entries/current.json

You should get a json formatted string back. It will look like this:

[{"_id":"5c64e08d935f13a6221e6933","sgv":136,"date":1550114905000,"dateString":"2019-02-14T03:28:25.000Z","trend":4,"direction":"Flat","device":"share2","type":"sgv"}]

You extract the data with a template like this:

value_template: '{{ value_json[0].sgv }}'

I think I got it now, I had two sensor entities. Thank you guys for all your help. I am sure I will be back for more help. #noobstatus

I am curious, how do you parse out all of the JSON values coming from Nightscout? I should have probably posed this here, but I started a new post with that question and all of my details:

Hi there- for those following this, I wanted to share a new thread I started around using the CGM data.

Check it out and post your GGM data use examples:

Could you show an example of what would go in the Call Service node? I keep getting API errors with the current configuration.

Entity Id should be:

‘script.bg_tts_alarm’

On mine, the script itself sends the TTS message to the desired media player. All I am doing with the automation is calling the script.

So just to make sure, I should have it as such?

Also, here is the state node config. Does this look correct?

04 PM

Got it working! Had to make some adjustments to the script. Thanks again for the help.

#Blood Sugar Alarms
bg_tts_alarm:
  alias: BG TTS Alarm
  sequence:
  - service: notify.alexa_media
    data_template:
      data:
        type: announce
      target: media_player.master_bedroom
      message: "Wake up. NameHere has a blood sugar of {{states('sensor.json_sgv')}}."
1 Like

Hi, thought I might drop this information in here for anyone interested:
https://github.com/home-assistant/core/pull/33852

2 Likes

This would be awesome! Will it be integrated?

Still awaiting review, feel free to <3 or comment on the pull request to grab the attention of HA staff!

If you’d like to beta test the integration as a custom_component:

2 Likes

I tried… But no positive respons. There are somethings in the PR that should not be there was the answer i got.
My bet is that they are busy with the new beta.

I would like to have access to my G6 data without the cumbersome Heroku app, but…
I am running Home Assistant in a Docker on an Intel NUC running Ubuntu. There is no homeassistant/custom_components folder. I tried mkdir custom_components then adding the /dexcom folder in /usr/share/hassio/homeassistant/custom_components, but in Configuration -> Integrations -> +, there is no Dexcom to configure.

Does it matter that root owns everything in /usr/share/hassio/homeassistant?

Any tips would be appreciated.

Be sure to do a restart, and be sure it’s just the /dexcom folder in there, not the whole repository.

The directory structure you have is identical to mine.

Thanks. Did a restart, still not there.

steve@nuc:/usr/share/hassio/homeassistant/custom_components$ ls -al
drwxr-xr-x 2 root root 4096 May 15 13:00 dexcom

cd dexcom

steve@nuc:/usr/share/hassio/homeassistant/custom_components/dexcom$ ls -al
-rwxr--r-- 1 root root 1848 May 15 12:59 config_flow.py
-rwxr--r-- 1 root root  389 May 15 12:59 const.py
-rwxr--r-- 1 root root 3011 May 15 12:59 __init__.py
-rwxr--r-- 1 root root  291 May 15 12:59 manifest.json
-rwxr--r-- 1 root root 4133 May 15 12:59 sensor.py
-rwxr--r-- 1 root root  618 May 15 12:59 strings.json

Other ideas?