Mijn vraag
Ik heb een tablet gekocht met POE, deze werkt perfect in mijn hass. Alleen nu heeft hij 2 ledbalkjes die je kan bedienen. Maar ik heb hier te weinig ervaring mee dat ik er niet uitkom hoe ik dit als licht entiteit in hass kan maken. Ik kreeg de "api" van de Chinese verkoper. Iemand die me hier mee kan helpen?
Relevante software en hardware die ik gebruik
Hass, POE tablet, unifi,
Wat ik al gevonden of geprobeerd heb
private static final String RGB_RED_76S08P = "71";
private static final String RGB_GREEN_76S08P = "70";
private static final String RGB_BLUE_76S08P = "87";
private void setGpioStatus(String gpioNumber, int gpioState) {
String command_1 = "echo " + gpioNumber + " > /sys/class/gpio/export";
String command_2 = "echo out > /sys/class/gpio/gpio" + gpioNumber + "/direction";
String command_3 = "echo " + gpioState + " > /sys/class/gpio/gpio" + gpioNumber + "/value";
String[] commandArray = new String[]{command_1, command_2, command_3};
ShellUtils.CommandResult result = execCommand(commandArray, true);
if (result.successMsg != null) {
Log.d(TAG, result.successMsg);
}
Log.d(TAG, command_1);
Log.d(TAG, command_2);
Log.d(TAG, command_3);
}
Ik heb een tablet gekocht met POE, deze werkt perfect in mijn hass. Alleen nu heeft hij 2 ledbalkjes die je kan bedienen. Maar ik heb hier te weinig ervaring mee dat ik er niet uitkom hoe ik dit als licht entiteit in hass kan maken. Ik kreeg de "api" van de Chinese verkoper. Iemand die me hier mee kan helpen?
Relevante software en hardware die ik gebruik
Hass, POE tablet, unifi,
Wat ik al gevonden of geprobeerd heb
private static final String RGB_RED_76S08P = "71";
private static final String RGB_GREEN_76S08P = "70";
private static final String RGB_BLUE_76S08P = "87";
private void setGpioStatus(String gpioNumber, int gpioState) {
String command_1 = "echo " + gpioNumber + " > /sys/class/gpio/export";
String command_2 = "echo out > /sys/class/gpio/gpio" + gpioNumber + "/direction";
String command_3 = "echo " + gpioState + " > /sys/class/gpio/gpio" + gpioNumber + "/value";
String[] commandArray = new String[]{command_1, command_2, command_3};
ShellUtils.CommandResult result = execCommand(commandArray, true);
if (result.successMsg != null) {
Log.d(TAG, result.successMsg);
}
Log.d(TAG, command_1);
Log.d(TAG, command_2);
Log.d(TAG, command_3);
}