10-20-2023 09:20 PM
I get a Validation Error "Required field for struct is missing. Expected subfields: [channelCode]." ** see this line
metadata:
name: Lounge TV 6:30PM Weekdays
description: Turns on the Lounge TV and sets the channel to 10HD on weekdays at 6:30 PM.
automations:
- starters:
- type: time.schedule
at: "6:30 PM"
weekdays:
- MON
- TUE
- WED
- THU
- FRI
actions:
- type: device.command.SelectChannel
channelName: 10HD ## This line causing Validation Error - why?? it appears valid (ive tried "10HD" with same result. SelectChannel is a valid command why does validation expect "channelCode" as it reports (please)
devices: "Lounge TV - Lounge"
10-24-2023 01:33 PM
Hey @Loz_in_Oz , I don't have a device that supports this action myself but are you able to use any of the other parameters for the SelectChannel action like channelCode for your script? Adding a link to the reference documentation for this particular action - https://developers.home.google.com/automations/schema/reference/entity/sht_device/select_channel_com...
10-24-2023 07:05 PM
Hi thank-you for your reply and follow-up. As you suggested I already bypassed (for now) the failing validation script by using the (far less user friendly) channelCode alternative way to select a Channel and this works. I’m very new to this script editor but pretty sure it’s a bug ie it’s just incorrectly rejecting (not validating) a valid parameter. Instead of a simple user readable “10HD” channel name on has to use:
actions:
- type: device.command.SelectChannel # Set the current channel to a specific value.
# [Available parameter options: channelName, channelNumber, channelCode]
channelCode: 56345094:8ae222e2-e992-484a-8c7e-4a753134318c
devices: Lounge TV - Lounge
10-25-2023 08:54 AM
I agree that does seem less convenient than just providing the channel number or name. Which device make/model is your "Lounge TV" ? If you don't mind, can you file a feedback report from home.google.com > three dot icon in the upper right corner > Send feedback? I'll flag this to my team to take a look. Thanks!
10-26-2023 01:45 AM
Thanks again for follow-up. Yes I’ll certainly send feedback report. If I may suggest, this bug / issue doesn’t to me appear to be TV model / make related, as the action that is failing the validation is rejecting a documented / prescribed parameter ‘channelName’ with an illogical error stating it expects ‘channelcode’. It should only expect channelCode if user had specified channelCode as the input parameter (and only then fail validation if entered parameter was invalid). For completeness the channelName parameter I used is both valid and prompted by script editor assisted input.
my Tv is an LG smart OLED TV. Model LGOLED65B6T LAN Connected. I’m 99% sure the tv model is not relevant for this particular issue.
12-05-2023 06:13 PM
Any update on this please the bug / feature appears to persist ( I did file the feedback).
I did look at this which added to my confusion as it states channelCode is a required parameter, which leads me to ask why the other two options exist, as they don’t work unless channelCode is stated in script? https://developers.home.google.com/automations/schema/reference/entity/sht_device/select_channel_com...
Thanks
12-18-2023 10:58 AM
Hey @Loz_in_Oz - Sorry for the delay; I've flagged this to my team to get some clarity for the selectChannel action. Thanks for your patience.
12-19-2023 01:02 AM
Please ask them to refer to the Google link I sent in my message before, specifically it (incorrectly / illogically?) states that ‘channelCode’ is required vs two alternatives which are optional?? One can only program script with one of the three options I beleive (that’s how it reads) but if one is mandatory - how can one use either of the other two alternative’s? As already mentioned the channelCode is the least user / scripting friendly of the three so imho all three should be optional ie all should work, allow script writer to choose.
thanks