Sorry for the stupid question.
I have several switch types in my home with different configuration and I need to perform some action with them. Action logic depends on switch configuration. For example if Switch is MQTT and command_topiс contains “-bridge-” - perform some extra steps.
But I can’t find how to get configuration yaml (dictionary) having only entity_id.
I can get state like
toilet_light= hass.states.get('switch.toilet_light')
but how to return configuration below?
- platform: mqtt
name: toilet_light
availability_topic: 'tele/rf-bridge-first-floor/LWT'
payload_available: 'Online'
payload_not_available: 'Offline'
state_topic: 'stat/rf-sensor-toilet/STATE'
state_off: 'OFF'
state_on: 'ON'
command_topic: 'cmnd/rf-bridge-first-floor'
payload_on: "on"
payload_off: "off"