Change the health endpoint for heartbeat messages

Hi it’s Luca,
I’ve got a working Thin edge installation connected to Cumulocity. My goal is to make the device status to reflect the status of the my application

So I’m trying to change the default health endpoint from the agent to my application, following this part of the doc.

In particular, I’m trying with this command:

mosquitto_pub -r -q 2 -t 'te/device/main//' -m '{"@health": "device/main/service/logger"}'

But i get:

te/errors Unexpected error: Invalid entity registration message received on topic: te/device/main//

Note that I didn’t send any explicit registration message before and so this is what i get when I do mosquitto_sub -t '#' -v:

2025-04-15 14:43:48 te/device/main/service/mosquitto-c8y-bridge {"@id":"luca:device:main:service:mosquitto-c8y-bridge","@parent":"device/main//","@type":"service","name":"mosquitto-c8y-bridge","type":"service"}
2025-04-15 14:43:48 te/device/main/service/mosquitto-c8y-bridge/status/health 1
2025-04-15 14:43:48 te/device/main/service/tedge-mapper-c8y {"@parent":"device/main//","@type":"service","type":"service"}
2025-04-15 14:43:48 te/device/main/service/tedge-mapper-c8y/status/health {"pid":91183,"status":"up","time":1744707843.8817255}
2025-04-15 14:43:48 te/device/main/service/c8y-firmware-plugin {"@id":"luca:device:main:service:c8y-firmware-plugin","@parent":"device/main//","@type":"service","name":"c8y-firmware-plugin","type":"service"}
2025-04-15 14:43:48 te/device/main/service/c8y-firmware-plugin/status/health {"pid":1256,"status":"up","time":1744707844.2420063}
2025-04-15 14:43:48 te/device/main/service/tedge-agent {"@id":"luca:device:main:service:tedge-agent","@parent":"device/main//","@type":"service","name":"tedge-agent","type":"service"}
2025-04-15 14:43:48 te/device/main/service/tedge-agent/status/health {"pid":1257,"status":"up","time":1744707844.2421002}
2025-04-15 14:43:48 te/device/main// {"@health": "device/main/service/logger", "@type": "device"}
2025-04-15 14:43:48 te/device/main///twin/c8y_Agent {"name":"thin-edge.io","url":"https://thin-edge.io","version":"1.4.2"}
2025-04-15 14:43:48 te/device/main///cmd/config_snapshot/c8y-mapper-26768774 {"status":"init","tedgeUrl":"http://127.0.0.1:8000/tedge/file-transfer/luca/config_snapshot/default-c8y-mapper-26768774","type":"default"}```