๐Ÿž [BUG] Describe the issue clearly here

Environment

  • Astrion firmware:
  • RosCard version:
  • Home Assistant version:
  • Network type (local / VPN / remote):

Issue Description

Describe what is happening.

Expected Behavior

What should happen?

Actual Behavior

What actually happens?

Steps to Reproduce

Additional Info

Logs, screenshots, or observations.

2 posts were merged into an existing topic: :locked_with_key: Security discussion: tokens, access control & remote access

Environment

  • Astrion Software Version: 1.1.0

  • Astrion firmware: 2025111419

  • RosCard version: 1.0.8

  • Home Assistant version:

    Core 2026.2.2

    Supervisor 2026.02.2

    Operating System 17.1

    Frontend 20260128.6

  • Network type (local / VPN / remote): Local

Issue Description:

I have an odd issue which I think is a bug but Iโ€™m happy to be corrected. I have a Sony TV, Yamaha Sound Bar and Foxtel Set Top Box. The Sony TV and Yamaha Sound Bar have native HA integrations however for the Foxtel STB I need to use a Broadlink Mini RM4 IR Blaster.

Since the STB isnโ€™t native I cannot just use a Scene to activate all devices. I need to use a Scene, Automation and a script. The Scene turns on the TV and Amp, and the automation via an Event Trigger (call_service) launches a script as an action to turn on the Foxtel unit.

If I launch the scene via HA all works as expected. The TV, Amp and Foxtel box turn on. I see in the listener events that the IR script is being fired. I believe this proves end to end in HA that the Scene, Automation and Script are functional.

If I bind the Scene to the Scene Ros Card and launch it the TV and the Amp are powered on but the automation never fires. I donโ€™t see the script event in the listener.

In the listner logs the format for entity id as seen in Event 0 is different when comparing the one launched manually by HA and the other via the Astrion. One has a hypen and one does not. Iโ€™m not sure if that makes a difference as my understadning the syntax is still correct.

Working Launched from HA

Not Working when using Astrion

Automation

Iโ€™m at a loss why it does not work. In my opinion i thought the only thing the Astrion does is launch the Scene and HA should do the rest. Makes no sense to me why when launching the Scene in HA works but not from the remote.

Hi @MRRIZK โ€” thank you for the extremely clear report and full environment details. This is exactly the kind of diagnostic info that helps us narrow things down quickly :raising_hands:

Iโ€™ve reviewed your scenario carefully, and your reasoning is actually correct:

Astrion should only trigger the Scene, and Home Assistant should handle everything else.

Since the Scene works perfectly when launched inside Home Assistant but not when triggered from Astrion, that tells us:

:white_check_mark: Scene itself is valid
:white_check_mark: Automation logic is valid
:white_check_mark: Script is valid
:red_exclamation_mark: The difference must be how the Scene is being called


:magnifying_glass_tilted_right: Root Cause (Very Likely)

The issue is almost certainly caused by event trigger filtering mismatch in your automation.

Your automation is listening for:

event_type: call_service

But when Astrion calls a scene, the service call metadata is slightly different from when HA UI calls it.

Even if both trigger the same scene, HA treats them as different call contexts.


Why This Happens

Home Assistant automations triggered by:

platform: event
event_type: call_service

are extremely sensitive to:

  • domain

  • service

  • entity_id format

  • context

  • caller source

Astrion sends a valid service call โ€” but not identical metadata to the UI call.

So your automation never matches the trigger condition.


:white_check_mark: Recommended Fix (Best Practice)

Instead of triggering automation from a service call event, trigger it from a state change or directly call the script.


:check_mark: Option A โ€” Best Solution

Bind Astrion directly to a script instead of a scene.

Example RosCard action:

service: script.watch_tv

Then your script:

script.watch_tv:
  sequence:
    - service: scene.turn_on
      target:
        entity_id: scene.living_room
    - delay: 2
    - service: script.turn_on_foxtel

Why this works better:

  • avoids event listener edge cases

  • deterministic execution

  • fewer layers

  • easier debugging

:backhand_index_pointing_right: This is the architecture we recommend internally as well.


:check_mark: Option B โ€” Fix Your Current Automation

Modify your automation trigger to listen for state change instead of service call:

Example:

trigger:
  - platform: state
    entity_id: scene.living_room

or

trigger:
  - platform: state
    entity_id: media_player.tv
    to: "on"

This removes dependency on call source.


:check_mark: Option C โ€” Relax Event Filter (Advanced)

If you want to keep using event triggers, remove strict filters like:

event_data:
  domain: scene
  service: turn_on

and only filter by entity_id.


:brain: Why Your Hyphen Observation Matters

You noticed entity IDs appearing slightly different. Thatโ€™s a good catch.

However, thatโ€™s usually just:

  • frontend formatting

  • logging representation

  • or JSON serialization differences

It rarely breaks service execution โ€” but it can break automations that match strings exactly.

So your instinct was correct :+1:


:star: Recommended Architecture Going Forward

For the most stable results:

Astrion Button โ†’ HA Script โ†’ (Scenes + Commands + IR + Delays)

Avoid:

Astrion โ†’ Scene โ†’ Automation โ†’ Script

The shorter the chain, the more reliable the system.


:white_check_mark: Summary

Nothing is actually โ€œbrokenโ€ โ€” youโ€™ve just hit a known edge case:

Component Status
Scene Working
Automation Working
Script Working
Astrion call Working
Trigger match :cross_mark: Too strict

Fix = adjust trigger method or call script directly.