Tiny Bubbles and a Very Stubborn Weather Forecast
Zemismart ZMZ609-2 · Zigbee · Zigbee2MQTT · Home Assistant
Quick Take
The Zemismart ZMZ609-2 is a well-built, single-gang Zigbee switch with two channels, a touchscreen, a clock, current weather, and a few customization options. Installation was easy, and Home Assistant integration gave me plenty of room to have fun. Getting the weather working was another story. After weeks of troubleshooting, I finally got it working without a custom Zigbee2MQTT converter, although some weather icons are still questionable. At around $40 on sale, I'm not entirely convinced it's worth the price.
The easy part
I installed the Zemismart ZMZ609-2 in my bathroom about 7 weeks ago.
The switch was the easy part. The weather? That's where I lost a ridiculous amount of time.

In my experience, Zemismart products feel well made, and this was no exception. It was a snug fit in my crowded electrical box, but I appreciated the traditional screw terminals instead of a mess of pigtail wires. Installation went smoothly.
Pairing took me a minute because I missed the swipe-in menu on the left edge of the screen. Once I found it, Zigbee2MQTT picked it up without a manufacturer's app. That's the kind of Zigbee experience I love.
I don't actually use the switch to control wired loads, but I can hear the relays click. I haven't tested them under load, but they sound good. The touchscreen is responsive, the clock just works, and the product is fun to touch.
It has two configurable button icons, though you set them on the switch itself. Changing the button names in Zigbee2MQTT updates Home Assistant, not the labels on the physical screen. That seems like an odd missed opportunity for dynamic functionality.
Tiny Bubbles, please
My bathroom lights already turn themselves on using a presence sensor. I didn't need another ordinary light switch.
Instead, button one gives me manual lighting control. Button two? Sends me to Hawaii.
Press it, and Home Assistant changes the switch's weather from my hometown to Waikiki. A cheerful AI-generated “island” voice gives me the forecast and a randomized welcome message, Music Assistant starts my Tiny Bubbles playlist, and the bathroom bulbs slowly cycle through tropical colors.
Fifteen minutes later—or whenever I switch it off—the music stops, the lights return to normal, and Colorado weather comes back. A quick getaway, whenever you want.

The forecast calls for frustration
When I first installed the ZMZ609-2, the clock just worked. The weather kept showing sunny. Unlike the clock, the weather doesn't update on its own. Zigbee2MQTT requires an automation to push the current conditions.
A few weeks after installation, I started digging into errors. Zigbee2MQTT recognized the device, but its weather handling was failing. A custom external converter got the data flowing, and for a moment I thought I'd solved it.
I hadn't.
I revisited the problem repeatedly over the next several weeks. Native Zigbee2MQTT was supposed to work, but removing my converter brought the errors back. There were also the weather icons. ☹
I built a test dashboard, tried numeric codes, changed my automation, and spent weeks sailing in circles around the same little island of problems. I even asked Zemismart for the complete weather-code list, especially the nighttime icons. They followed up with an engineer, but I never received a different mapping.

Here's the embarrassing part. The Zigbee2MQTT documentation had listed a condition called yin all along. I kept looking for the right nighttime code and somehow overlooked that one.
Today, I finally added yin for clear nights. Unfortunately, it still looks a lot like rain.
So, after weeks of troubleshooting, the weather updates work, but I still need a custom converter, and several weather icons remain difficult to distinguish. That's especially disappointing heading into fall/winter, when so much of the day is dark.
Would I keep it?
For now. It's a well-built, attractive Zigbee switch with two channels, a nice touchscreen, a clock, current weather, and a few other display options. If that's what you're looking for, there's a lot to like.
Just don't expect a miniature Home Assistant dashboard, and be prepared for some tinkering if you want weather working through Zigbee2MQTT.
For me, wall space is at a premium. I only have two switch boxes with neutral wires in my whole house, and that makes each one valuable real estate.
I had a lot of fun with this switch, especially Tiny Bubbles. But I'm not sure it's earned a permanent home. Something more capable might eventually take its place.
Until then, aloha!
Resources
I didn't figure this out on my own. Credit goes to lboue, who originally reverse-engineered the ZMZ609-2 and brought support to Zigbee2MQTT. Here is their Home Assistant Community write-up.
For anyone who wants to experiment, here's what I'm currently using:
My custom Zigbee2MQTT converter ZMZ609-2_weather_converter.js
// Temporary external converter for bathroom_light_switch (Zemismart ZMZ609-2).
// Preserve the native switch, radar and power mappings; fix the Tuya weather payload.
import * as exposes from 'zigbee-herdsman-converters/lib/exposes';
import {logger} from 'zigbee-herdsman-converters/lib/logger';
import * as tuya from 'zigbee-herdsman-converters/lib/tuya';
const e = exposes.presets;
const ea = exposes.access;
const NS = 'zhc:zemismart-zmz609-2-weather-fix';
const screenName = {
to: (v) => {
const bytes = Array.from(Buffer.from(String(v ?? ''), 'utf8'));
return [0x00, (bytes.length >> 8) & 0xff, bytes.length & 0xff, ...bytes];
},
from: (v) => {
const buffer = Buffer.from(Object.values(v));
if (buffer.length >= 3 && buffer[0] === 0x00) {
const declaredLength = buffer.readUInt16BE(1);
return buffer.subarray(3, 3 + declaredLength).toString('utf8').replace(/\0+$/g, '');
}
return buffer.toString('utf8').replace(/\0+$/g, '');
},
};
const radarDistance = tuya.valueConverterBasic.lookup({
short: tuya.enum(0),
medium_short: tuya.enum(1),
medium: tuya.enum(2),
medium_long: tuya.enum(3),
long: tuya.enum(4),
});
const screenOffTime = tuya.valueConverterBasic.lookup({
none: tuya.enum(0),
'10': tuya.enum(1),
'20': tuya.enum(2),
'30': tuya.enum(3),
'45': tuya.enum(4),
'60': tuya.enum(5),
});
const ignoreTuyaConfigureResponse = {cluster: 0xe000, type: ['raw'], convert: () => undefined};
const exactWeatherConditionCodes = Object.fromEntries(Array.from({length: 256}, (_, code) => [`code\_${code}`, code]));
const zmz609WeatherConditionMap = {
...exactWeatherConditionCodes,
...tuya.M8ProTuyaWeatherCondition,
mostly_sunny: 119,
sunny: 120,
};
function fixedTuyaWeatherForecast(args = {}) {
const {includeCurrentWeather = true, numberOfForecastDays = 0, correctForNegativeValues = false, weatherConditionMap = tuya.M8ProTuyaWeatherCondition} = args;
const tzFields = includeCurrentWeather ? ['temperature_0', 'humidity_0', 'condition_0'] : [];
for (let i = 1; i <= numberOfForecastDays; ++i) {
tzFields.push(`temperature\_${i}`, `humidity\_${i}`, `condition\_${i}`);
}
function vCorr(val) {
if (correctForNegativeValues && val < 1) return val - 1;
return val;
}
function prepareTuyaWeatherSyncPayload(meta, requestedForecastDays, requestedCurrentWeather, requestedWeatherIds = [1, 2, 3]) {
let bOffset = 0;
const sampleCount = requestedForecastDays + (requestedCurrentWeather ? 1 : 0);
const weatherIds = requestedWeatherIds.filter((id) => [1, 2, 3].includes(id));
const bytesPerValue = {1: 2, 2: 2, 3: 1};
const payloadSize = 6 + weatherIds.reduce((size, id) => size + 1 + sampleCount * bytesPerValue[id], 0) + 1;
const buffer = Buffer.alloc(payloadSize);
buffer.writeUInt8(0x11, bOffset++);
buffer.writeUInt8(0, bOffset++);
buffer.writeUInt8(0x12, bOffset++);
buffer.writeUInt8(requestedForecastDays, bOffset++);
buffer.writeUInt8(0x13, bOffset++);
const weatherValues = {1: [], 2: [], 3: []};
const conditionStrings = [];
if (requestedCurrentWeather) {
buffer.writeUInt8(0x1, bOffset++);
weatherValues[tuya.TuyaWeatherID.Temperature].push('temperature_0' in meta.state ? vCorr(meta.state.temperature_0) : 0);
weatherValues[tuya.TuyaWeatherID.Humidity].push('humidity_0' in meta.state ? meta.state.humidity_0 : 0);
conditionStrings.push('condition_0' in meta.state ? meta.state.condition_0 : undefined);
weatherValues[tuya.TuyaWeatherID.Condition].push('condition_0' in meta.state ? weatherConditionMap[meta.state.condition_0] : 0);
} else {
buffer.writeUInt8(0x0, bOffset++);
}
for (let i = 1; i <= requestedForecastDays; ++i) {
weatherValues[tuya.TuyaWeatherID.Temperature].push(`temperature\_${i}` in meta.state ? vCorr(meta.state[`temperature\_${i}`]) : 0);
weatherValues[tuya.TuyaWeatherID.Humidity].push(`humidity\_${i}` in meta.state ? meta.state[`humidity\_${i}`] : 0);
conditionStrings.push(`condition\_${i}` in meta.state ? meta.state[`condition\_${i}`] : undefined);
weatherValues[tuya.TuyaWeatherID.Condition].push(`condition\_${i}` in meta.state ? weatherConditionMap[meta.state[`condition\_${i}`]] : 0);
}
for (const id of weatherIds) {
buffer.writeUInt8(id, bOffset++);
for (const value of weatherValues[id]) {
if (id === tuya.TuyaWeatherID.Temperature || id === tuya.TuyaWeatherID.Humidity) {
buffer.writeInt16BE(value, bOffset);
bOffset += 2;
} else if (id === tuya.TuyaWeatherID.Condition) {
buffer.writeUInt8(value, bOffset++);
}
}
}
buffer.writeUInt8(0, bOffset++);
logger.debug(() => `weather debug: requestedWeatherIds=${JSON.stringify(weatherIds)}, requestedForecastDays=${requestedForecastDays}, requestedCurrentWeather=${requestedCurrentWeather}, conditionStrings=${JSON.stringify(conditionStrings)}, conditionValues=${JSON.stringify(weatherValues[tuya.TuyaWeatherID.Condition])}, payload=${JSON.stringify(Array.from(buffer))}`, NS);
return buffer;
}
function prepareRequestedConditionPayload(meta, requestedForecastDays, requestedCurrentWeather) {
const state = {...meta.state};
for (let day = 1; day <= requestedForecastDays; day++) {
state[`condition\_${day}`] = state.condition_0;
}
return prepareTuyaWeatherSyncPayload({...meta, state}, requestedForecastDays, requestedCurrentWeather, [3]);
}
const fzConverter = {
type: ['commandTuyaWeatherRequest'],
cluster: 'manuSpecificTuya',
convert: (model, msg, publish, options, meta) => {
if (msg.type !== 'commandTuyaWeatherRequest') return;
let bOffset = 0;
const buffer = msg.data.payload;
buffer.readUInt16LE(bOffset);
bOffset += 2;
buffer.readUInt8(bOffset++);
buffer.readUInt8(bOffset++);
const weather_request = [];
let nextField = buffer.readUInt8(bOffset++);
while (nextField !== 0x12 && nextField !== 0x13) {
weather_request.push(nextField);
nextField = buffer.readUInt8(bOffset++);
}
const requestedForecastDays = nextField === 0x12 ? buffer.readUInt8(bOffset++) : 0;
if (nextField === 0x12) buffer.readUInt8(bOffset++);
const requestedCurrentWeather = buffer.readUInt8(bOffset++) !== 0;
logger.debug(() => `weather request debug: inbound=${JSON.stringify(Array.from(buffer))}, parsedWeatherIds=${JSON.stringify(weather_request)}, requestedForecastDays=${requestedForecastDays}, requestedCurrentWeather=${requestedCurrentWeather}`, NS);
const payload = prepareRequestedConditionPayload(meta, requestedForecastDays, requestedCurrentWeather);
msg.endpoint.command('manuSpecificTuya', 'tuyaWeatherSync', {payload})
.catch((error) => logger.warning(() => `Failed to sync '${msg.device.ieeeAddr}:${msg.endpoint.ID}' on weather request (${error})`, NS));
},
};
const tzConverter = {
key: tzFields,
convertSet: async (entity, key, value, meta) => {
const state = {};
for (const field of tzFields) {
if (Object.hasOwn(meta.message, field)) {
state[field] = meta.message[field];
meta.state[field] = state[field];
}
}
const payload = prepareTuyaWeatherSyncPayload(meta, numberOfForecastDays, includeCurrentWeather, [1, 2, 3]);
await entity.command('manuSpecificTuya', 'tuyaWeatherSync', {payload})
.catch((error) => logger.warning(() => `Failed to sync weather (${error})`, NS));
if (Object.hasOwn(state, 'condition_0')) {
const conditionPayload = prepareRequestedConditionPayload(meta, 1, true);
await entity.command('manuSpecificTuya', 'tuyaWeatherSync', {payload: conditionPayload})
.catch((error) => logger.warning(() => `Failed to sync current condition (${error})`, NS));
}
return {state};
},
};
return {configure: [], isModernExtend: true, fromZigbee: [fzConverter], toZigbee: [tzConverter]};
}
const weather = fixedTuyaWeatherForecast({numberOfForecastDays: 0, weatherConditionMap: zmz609WeatherConditionMap});
export default {
fingerprint: tuya.fingerprint('TS0601', ['_TZE284_o409r73p', '_TZE28C1000000_o409r73p']),
model: 'ZMZ609-2',
vendor: 'Zemismart',
description: 'Zigbee neutral touchscreen switch 2 gang with power monitoring (weather buffer fix)',
extend: [tuya.modernExtend.tuyaBase({dp: true, timeStart: '1970', forceTimeUpdates: true, queryOnConfigure: true})],
fromZigbee: [tuya.fz.datapoints, ...weather.fromZigbee, ignoreTuyaConfigureResponse],
toZigbee: [...weather.toZigbee, tuya.tz.datapoints],
endpoint: () => ({l1: 1, l2: 1}),
exposes: [
e.switch().withEndpoint('l1').setAccess('state', ea.STATE_SET),
e.switch().withEndpoint('l2').setAccess('state', ea.STATE_SET),
e.numeric('countdown_l1', ea.STATE_SET).withUnit('s').withValueMin(0).withValueMax(43200).withValueStep(1).withDescription('Countdown for gang 1'),
e.numeric('countdown_l2', ea.STATE_SET).withValueMin(0).withValueMax(43200).withValueStep(1).withUnit('s').withDescription('Countdown for gang 2'),
e.power_on_behavior().withAccess(ea.STATE_SET),
e.power_on_behavior().withEndpoint('l1').withAccess(ea.STATE_SET),
e.power_on_behavior().withEndpoint('l2').withAccess(ea.STATE_SET),
e.binary('radar_switch', ea.STATE_SET, 'ON', 'OFF').withDescription('Radar switch'),
e.child_lock(),
e.numeric('backlight', ea.STATE_SET).withUnit('%').withValueMin(0).withValueMax(100).withValueStep(1).withDescription('Backlight brightness'),
e.enum('radar_distance', ea.STATE_SET, ['short', 'medium_short', 'medium', 'medium_long', 'long']).withDescription('Radar distance'),
e.enum('screen_off_time', ea.STATE_SET, ['none', '10', '20', '30', '45', '60']).withDescription('Screen off time'),
e.text('name', ea.STATE_SET).withEndpoint('l1').withDescription('Display name for gang 1'),
e.text('name', ea.STATE_SET).withEndpoint('l2').withDescription('Display name for gang 2'),
e.energy(),
e.current(),
e.power(),
e.voltage(),
],
meta: {
multiEndpoint: true,
tuyaDatapoints: [
[1, 'state_l1', tuya.valueConverter.onOff],
[2, 'state_l2', tuya.valueConverter.onOff],
[7, 'countdown_l1', tuya.valueConverter.countdown],
[8, 'countdown_l2', tuya.valueConverter.countdown],
[13, null, {from: () => undefined}],
[14, 'power_on_behavior', tuya.valueConverter.powerOnBehaviorEnum],
[16, 'radar_switch', tuya.valueConverter.onOff],
[20, 'energy', tuya.valueConverter.divideBy1000],
[21, 'current', tuya.valueConverter.divideBy1000],
[22, 'power', tuya.valueConverter.divideBy10],
[23, 'voltage', tuya.valueConverter.divideBy10],
[29, 'power_on_behavior_l1', tuya.valueConverter.powerOnBehaviorEnum],
[30, 'power_on_behavior_l2', tuya.valueConverter.powerOnBehaviorEnum],
[101, 'child_lock', tuya.valueConverter.onOff],
[102, 'backlight', tuya.valueConverter.raw],
[104, 'radar_distance', radarDistance],
[105, 'name_l1', screenName],
[106, 'name_l2', screenName],
[111, 'screen_off_time', screenOffTime],
[112, null, {from: () => undefined}],
[113, null, {from: () => undefined}],
],
},
};
My hourly weather automation
alias: Bathroom switch — hourly current weather
description: >-
Hourly current outdoor temperature in Celsius, humidity, and native
Zigbee2MQTT weather condition from PirateWeather.
triggers:
- trigger: time_pattern
minutes: '0'
- trigger: homeassistant
event: start
conditions:
- condition: not
conditions:
- condition: state
entity_id: weather.pirateweather
state:
- unknown
- unavailable
actions:
- action: mqtt.publish
data:
topic: zigbee2mqtt/bathroom_light_switch/set
qos: 0
retain: false
payload: >-
{% set w = states('weather.pirateweather') %} {% set m = {
'sunny': 'sunny',
'clear-night': 'yin',
'partlycloudy': 'cloudy',
'cloudy': 'cloudy',
'overcast': 'cloudy',
'rainy': 'rain',
'pouring': 'heavy_downpour',
'lightning': 'thunder_shower',
'lightning-rainy': 'thunder_shower',
'snowy': 'snow',
'snowy-rainy': 'sleet',
'fog': 'fog',
'freezing_fog': 'freezing_fog',
'hail': 'hailstone',
'windy': 'cloudy',
'windy-variant': 'cloudy',
'exceptional': 'heavy_downpour'
} %} {% set c = m.get(w, 'cloudy') %} {% set t =
((state_attr('weather.pirateweather', 'temperature') | float(0) - 32) *
5 / 9) | round(0) | int %} {% set h =
state_attr('weather.pirateweather', 'humidity') | int(0) %} {{
{'temperature_0': t, 'humidity_0': h, 'condition_0': c} | tojson }}
mode: single
These are the files used in my setup. The automation uses weather.pirateweather and zigbee2mqtt/bathroom_light_switch/set; replace them for your setup. Its temperature calculation assumes the weather entity reports Fahrenheit and converts it to Celsius.


Comments
Post a Comment