#How do you debug issues like this?

1 messages ยท Page 1 of 1 (latest)

devout sage
#

I'm pretty sure it's from this:

  - service: system_log.write
    data:
      level: info
      message: >
        "Playing {{ show_title }} - Shield= {{ shield_id }} App_State= {{ states(shield_id) }}"

#

So what's the proper way to dump the states of an entity in a log?

#

If I remove, specifically the "states(shield_id)", then I make it further and it dies on this condition:

      - conditions:
          - condition: template
            value_template: "{{ is_state_attr(shield_id, 'app_id', 'com.plexapp.android') }}"

cursive peak
#

use the dev tools teplate tool to make sure your templates are evaluating how you think they are

devout sage
#

I'm just not sure how to bridge the gap between template and blueprint here, since the entities are provided from the blueprint ui

#

hard coding, i guess?

cursive peak
#

blueprint is still yaml script behind the scenes which you can open and view in notepad or something.

#

maybe when you do a states lookup, the entity needs to be in single quotes?
states('shield_id')??

devout sage
#

it's a variable being set in a "variables:" block, so that it expands the input into a variable readable by the template

cursive peak
#

{{ states('sensor.desktop_activewindow_2') }}

devout sage
#

!input shield_player

cursive peak
#

hrmm

devout sage
#

where the shield player is a media_player

cursive peak
#

yeah, I'm not sure.

devout sage
#

Like- I'm 100% sure this is all doable, I just need to figure out what the machine sees at different times and that's the hardest part, it seems

cursive peak
#

well, as I said... I have been using chatGPT to help troubleshoot my templates and scripts.,

#

it is not always right, but often provides a good idea to look more into

#

paste your code and the error and ask it to help you find the issue...

#

just don't put in sensative data

#

at best it'll help solve the issue, at worst, you'll get some good ideas to google.

#

haha

devout sage
#

Lol yeah, that's my typical expectation as well. It usually gets close enough to tell you what to google

#

fwiw, I used chatgpt first. It had some really unhelpful responses

#

It's literally giving me back the same input I give it saying that it should work, so ๐Ÿคทโ€โ™‚๏ธ

cursive peak
#

I asked, and it suggested that maybe the shield_id is being treated as a dictionary instead of a string or entity ID

devout sage
#

yeah, it likely is because it's a target selector from the input

#

is there a way to grab the entity id off of a target selector with one entity?

cursive peak
#

I'm not sure

#

I personally like to reverse engineer blueprints until I have a good understanding of them, and then build a more tailored solution for my needs. more customizable and easier to troubleshoot imo.

devout sage
#

Yeah, I hear you. It's been super hard finding exact references for things like this.
The documentation typically gives the most basic examples and everything else is figuring it out.

I had to install MQTT explorer before I was able to figure out the missing params in my payload to get device discovery to work ๐Ÿ˜ฆ

cursive peak
#

yeah... Homeassistant is mostly researching and troubleshooting and a little bit of enjoying your automations. lol

#

but, I love it, and for my needs it is the best available option.

devout sage
#

Yeah, it's super rad! I am an advocate, for sure

#

coming from the gamedev world, it's kind of in the "unreal" space- where it's really powerful, but the documentation might turn ppl away

cursive peak
#

I used to have smartthings... which was eh...
Then samsung bought it and it was gross.

#

found this and have been super happy with it

devout sage
#

Yeah, it feels so good to actually be in control of your smart home

cursive peak
#

right?

devout sage
#

I bought a multi relay and hooked up my dumb garage over the weekend

cursive peak
#

large learning curve, but good payout at the end

devout sage
#

even wrote a script to hold down the button until the door is closed because one of the eyes is broken

#

i love the control

cursive peak
#

nice

devout sage
#

and right now, I'm making buttons to play tv shows haha

cursive peak
#

I just got done writing a script to log the amount of youtube time on the tv, and to deny the app after a certain amount of time each day

#

lol

#

take that kids!

devout sage
#

lol poor kids are gonna have to learn their own whiley ways to get around it now

#

let the arms race of figuring shit out commence ๐Ÿ˜‰

cursive peak
#

yep

#

it'll make them critical thinkers

devout sage
#

love it

cursive peak
#

Anyways... gotta run. Glad you sorted out your issue. Happy automating!

devout sage
#

i remember running a 50ft ethernet cable from my sister's room when my dad shut me off haha

cursive peak
#

lol

devout sage
#

yeah! thanks for the help!

cursive peak
#

my dad put a bios password on our first pentium 386...

#

I figured out how to reset the bios via motherboard switch... ๐Ÿ˜ฎ

devout sage
#

that's extreme lol

cursive peak
#

he was like "wasn't there a password? what happened to the password"

#

before bios was smart...

#

anyways... later!

devout sage
#

have a good one!