Entities
Let's explore all entity types that are directly supported by SmartBeans. All these entity objects can be injected into a
SmartBean class using the @Entity
annotation. You only need to provide the entity ID of the Home Assistant entity that
you want to control with this object:
public class ASampleBean implements SmartBean {
@Entity("light.kitchen_ceiling")
private Light light;
}
The state of each entity is cached and shared across all beans. When calling methods like getState()
, the current
state is only retrieved from Home Assistant if needed - otherwise the cached value is returned. State updates are
handled automatically through Home Assistant's callback mechanism. This means you don't need to worry about manually
refreshing states. You will always get the current entity value, while benefiting from getter-like performance due to
the caching.
📄️ Binary Sensor
Entities of domain: binary_sensor
📄️ Camera
Entities of domain: camera
📄️ Climate
Entities of domain: climate
📄️ Cover
Entities of domain: cover
📄️ Light
Entities of domain: light
📄️ Lock
Entities of domain: lock
📄️ Media Player
Entities of domain: media_player
📄️ Scene
Entities of domain: scene
📄️ Sensor
Entities of domain: sensor
📄️ Switch
Entities of domain: switch
📄️ Vacuum
Entities of domain: vacuum
📄️ Helper
Helper entities in Home Assistant.