You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a new file src/accessories/tuya/tuya-motion-sensor.ts
`import { ZigBeeAccessory } from '../zig-bee-accessory';
import { Service } from 'homebridge';
import { MotionSensorServiceBuilder } from '../../builders/motion-sensor-service-builder';
import { BatteryServiceBuilder } from '../../builders/battery-service-builder';
This is a copy od Xiaomi sensor I only change the class name.
I also added to lines to index.ts
import { TuyaMotionSensor } from './accessories/tuya/tuya-motion-sensor';
and
registerAccessoryClass('TUYATEC-e4wp7oyu', ['RH3040'], TuyaMotionSensor);
And I think it's working after compilation.
So if it's so simple - is it possible to register new device changing only the homebridge configuration?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I just add a RH3040 motion sensor.
I created a new file src/accessories/tuya/tuya-motion-sensor.ts
`import { ZigBeeAccessory } from '../zig-bee-accessory';
import { Service } from 'homebridge';
import { MotionSensorServiceBuilder } from '../../builders/motion-sensor-service-builder';
import { BatteryServiceBuilder } from '../../builders/battery-service-builder';
export class TuyaMotionSensor extends ZigBeeAccessory {
private sensorService: Service;
private batteryService: Service;
getAvailableServices(): Service[] {
this.sensorService = new MotionSensorServiceBuilder(
this.platform,
this.accessory,
this.client,
this.state
)
.withOccupancy()
.build();
}
}`
This is a copy od Xiaomi sensor I only change the class name.
I also added to lines to index.ts
import { TuyaMotionSensor } from './accessories/tuya/tuya-motion-sensor';
and
registerAccessoryClass('TUYATEC-e4wp7oyu', ['RH3040'], TuyaMotionSensor);
And I think it's working after compilation.
So if it's so simple - is it possible to register new device changing only the homebridge configuration?
Beta Was this translation helpful? Give feedback.
All reactions