docs refresh

This commit is contained in:
Tester23 2024-03-05 15:51:15 +01:00
parent 7e59270362
commit c59e2ba686
10 changed files with 46 additions and 10 deletions

View File

@ -15,13 +15,13 @@ Do not add anything here, as it will overwritten with next rebuild.
|:------------- |------:|
| [IO/Pin Roles](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/ioRoles.md) (79 total) | You can set pin roles in 'Configure Module' section or use one of predefined templates in Web App. For each pin, you also set corresponding channel value. This is needed for modules with multiple relays. If you have 3 relays and 3 buttons, you need to use channel values like 1, 2, and 3. Just enter '1' in the text field, etc. |
| [Flags](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/flags.md) (47 total) | Flags are global and allows you to alter behaviour of the device. |
| [Drivers](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/drivers.md) (46 total) | Drivers allows you to control certain peripherals or enable certain features that are off by default. |
| [Script constants](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/constants.md) (34 total) | Every console command that takes an integer argument supports certain constant expansion. |
| [Drivers](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/drivers.md) (47 total) | Drivers allows you to control certain peripherals or enable certain features that are off by default. |
| [Script constants](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/constants.md) (36 total) | Every console command that takes an integer argument supports certain constant expansion. |
| [Channel Types](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/channelTypes.md) (51 total) | Channel types are often not required and don't have to be configured, but in some cases they are required for better device control from OpenBeken web panel. Channel types describes the kind of value stored in channel, for example, if you have a Tuya Fan Controller with 3 speeds control, you can set the channel type to LowMidHigh and it will display the correct UI radiobutton on OpenBeken panel.<br>Some channels have '_div10' or '_div100' suffixes. This is for TuyaMCU. This is needed because TuyaMCU sends values as integers, so it sends, for example, 215 for 21.5C temperature, and we store it internally as 215 and only convert to float for display. |
| [FAQ](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/faq.md) (31 total) | Here is a detailed list of questions you may ask. Some information from docs is repeated here. |
| [Console/Script commands](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md) (289 total) | There are multiple console commands that allow you to automate your devices. Commands can be entered manually in command line, can be send by HTTP (just like in Tasmota), can be send by MQTT and also can be scripted. |
| [Console/Script commands](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md) (290 total) | There are multiple console commands that allow you to automate your devices. Commands can be entered manually in command line, can be send by HTTP (just like in Tasmota), can be send by MQTT and also can be scripted. |
| [Command Examples](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commandExamples.md) (10 total) | Here you can find some examples of console commands usage |
| [Autoexec.bat examples (configs)](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md) (33 total) | Here you can find examples of autoexec.bat configs. The autoexec.bat file can be created in Web Application, under LittleFS tab, and is run every time device reboots (unless device enters safe mode/AP mode). The autoexec.bat file allows you to create more advanced configs, setup TuyaMCU mappings, etc |
| [Autoexec.bat examples (configs)](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md) (34 total) | Here you can find examples of autoexec.bat configs. The autoexec.bat file can be created in Web Application, under LittleFS tab, and is run every time device reboots (unless device enters safe mode/AP mode). The autoexec.bat file allows you to create more advanced configs, setup TuyaMCU mappings, etc |
| [MQTT Topics](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/mqttTopics.md) (25 total) | MQTT topic names and content for incoming and outgoing OBK MQTT publishes |
| [Script examples](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/scriptExamples.md) (6 total) | Scripts can be put in autoexec.bat and then they will start automatically on reboot, you can also put script in other LittleFS file and use startScript [fileName] [Label] command to run them. From the firmware point of view, scripts and autoexecs are basically the same thing. There is, however, a little bit more advanced system of execution for scripts which can be written in a form of scripts threads that run over time, can have delays within then, conditional checks and jumps. |
| [Console/Script commands [Extended Edition]](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands-extended.md) (289 total) | More details on commands. |
| [Console/Script commands [Extended Edition]](https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands-extended.md) (290 total) | More details on commands. |

View File

@ -198,7 +198,7 @@ Do not add anything here, as it will overwritten with next rebuild.
| setChannelType | [ChannelIndex][TypeString] | Sets a custom type for channel. Types are mostly used to determine how to display channel value on GUI.<br/><br/>See also [setChannelType on forum](https://www.elektroda.com/rtvforum/find.php?q=setChannelType). | File: new_pins.c<br/>Function: CMD_SetChannelType |
| SetChannelVisible | [ChannelIndex][bVisible] | This allows you to force-hide a certain channel from HTTP gui. The channel will still work, but will not show up as a button, or a toggle, etc...<br/><br/>See also [SetChannelVisible on forum](https://www.elektroda.com/rtvforum/find.php?q=SetChannelVisible). | File: cmnds/cmd_channels.c<br/>Function: CMD_SetChannelVisible |
| SetFlag | [FlagIndex][0or1] | Sets given flag.<br/><br/>See also [SetFlag on forum](https://www.elektroda.com/rtvforum/find.php?q=SetFlag). | File: cmnds/cmd_main.c<br/>Function: CMD_SetFlag |
| SetPinChannel | [PinIndex][ChannelIndex] | This allows you to set a channel linked to pin from console. Usually it's easier to do this through WWW panel, so you don't have to use this command.<br/><br/>See also [SetPinChannel on forum](https://www.elektroda.com/rtvforum/find.php?q=SetPinChannel). | File: cmnds/cmd_channels.c<br/>Function: CMD_SetPinChannel |
| SetPinChannel | [PinIndex][ChannelIndex][optionalChannel2Index] | This allows you to set a channel linked to pin from console. Usually it's easier to do this through WWW panel, so you don't have to use this command.<br/><br/>See also [SetPinChannel on forum](https://www.elektroda.com/rtvforum/find.php?q=SetPinChannel). | File: cmnds/cmd_channels.c<br/>Function: CMD_SetPinChannel |
| SetPinRole | [PinRole][RoleIndexOrName] | This allows you to set a pin role, for example a Relay role, or Button, etc. Usually it's easier to do this through WWW panel, so you don't have to use this command.<br/><br/>See also [SetPinRole on forum](https://www.elektroda.com/rtvforum/find.php?q=SetPinRole). | File: cmnds/cmd_channels.c<br/>Function: CMD_SetPinRole |
| SetStartValue | [Channel][Value] | Sets the startup value for a channel. Used for start values for relays. Use 1 for High, 0 for low and -1 for 'remember last state'.<br/><br/>See also [SetStartValue on forum](https://www.elektroda.com/rtvforum/find.php?q=SetStartValue). | File: cmnds/cmd_main.c<br/>Function: CMD_SetStartValue |
| SetupEnergyStats | [Enable1or0][SampleTime][SampleCount][JSonEnable] | Setup Energy Statistic Parameters: [enable 0 or 1] [sample_time[10..90]] [sample_count[10..180]] [JsonEnable 0 or 1]. JSONEnable is optional.<br/><br/>See also [SetupEnergyStats on forum](https://www.elektroda.com/rtvforum/find.php?q=SetupEnergyStats). | File: driver/drv_bl_shared.c<br/>Function: BL09XX_SetupEnergyStatistic |
@ -272,6 +272,7 @@ Do not add anything here, as it will overwritten with next rebuild.
| TS_Clear | | Clears the text scroller buffer.<br/><br/>See also [TS_Clear on forum](https://www.elektroda.com/rtvforum/find.php?q=TS_Clear). | File: driver/drv_textScroller.c<br/>Function: NULL); |
| TS_Print | [StartOfs] [MaxLenOr0] [StringText] [optionalBClampWithZeroesForClock] | Prints a text to the text scroller buffer.<br/><br/>See also [TS_Print on forum](https://www.elektroda.com/rtvforum/find.php?q=TS_Print). | File: driver/drv_textScroller.c<br/>Function: NULL); |
| tuyaMcu_defWiFiState | | Command sets the default WiFi state for TuyaMCU when device is not online. It may be required for some devices to work, because Tuya designs them to ignore touch buttons or beep when not paired. Please see [values table and description here](https://www.elektroda.com/rtvforum/viewtopic.php?p=20483899#20483899).<br/><br/>See also [tuyaMcu_defWiFiState on forum](https://www.elektroda.com/rtvforum/find.php?q=tuyaMcu_defWiFiState). | File: driver/drv_tuyaMCU.c<br/>Function: Cmd_TuyaMCU_Send_RSSI |
| tuyaMcu_sendCmd | TuyaMCU_SendUserCmd | .<br/><br/>See also [tuyaMcu_sendCmd on forum](https://www.elektroda.com/rtvforum/find.php?q=tuyaMcu_sendCmd). | File: driver/drv_tuyaMCU.c<br/>Function: NULL); |
| tuyaMcu_sendColor | [dpID] [red01] [green01] [blue01] [tuyaRGBformat] | This sends a TuyaMCU color string of given format for given RGB values, where each value is in [0,1] range as float.<br/><br/>See also [tuyaMcu_sendColor on forum](https://www.elektroda.com/rtvforum/find.php?q=tuyaMcu_sendColor). | File: driver/drv_tuyaMCU.c<br/>Function: NULL); |
| tuyaMcu_sendCurTime | | Sends a current date by TuyaMCU to clock/callendar MCU. Time is taken from NTP driver, so NTP also should be already running.<br/><br/>See also [tuyaMcu_sendCurTime on forum](https://www.elektroda.com/rtvforum/find.php?q=tuyaMcu_sendCurTime). | File: driver/drv_tuyaMCU.c<br/>Function: TuyaMCU_Send_SetTime_Current |
| tuyaMcu_sendHeartbeat | | Send heartbeat to TuyaMCU.<br/><br/>See also [tuyaMcu_sendHeartbeat on forum](https://www.elektroda.com/rtvforum/find.php?q=tuyaMcu_sendHeartbeat). | File: driver/drv_tuyaMCU.c<br/>Function: TuyaMCU_SendHeartbeat |

View File

@ -201,7 +201,7 @@ Do not add anything here, as it will overwritten with next rebuild.
| setChannelType | [ChannelIndex][TypeString] | Sets a custom type for channel. Types are mostly used to determine how to display channel value on GUI.<br/><br/>See also [setChannelType on forum](https://www.elektroda.com/rtvforum/find.php?q=setChannelType). |
| SetChannelVisible | [ChannelIndex][bVisible] | This allows you to force-hide a certain channel from HTTP gui. The channel will still work, but will not show up as a button, or a toggle, etc...<br/><br/>See also [SetChannelVisible on forum](https://www.elektroda.com/rtvforum/find.php?q=SetChannelVisible). |
| SetFlag | [FlagIndex][0or1] | Sets given flag.<br/><br/>See also [SetFlag on forum](https://www.elektroda.com/rtvforum/find.php?q=SetFlag). |
| SetPinChannel | [PinIndex][ChannelIndex] | This allows you to set a channel linked to pin from console. Usually it's easier to do this through WWW panel, so you don't have to use this command.<br/><br/>See also [SetPinChannel on forum](https://www.elektroda.com/rtvforum/find.php?q=SetPinChannel). |
| SetPinChannel | [PinIndex][ChannelIndex][optionalChannel2Index] | This allows you to set a channel linked to pin from console. Usually it's easier to do this through WWW panel, so you don't have to use this command.<br/><br/>See also [SetPinChannel on forum](https://www.elektroda.com/rtvforum/find.php?q=SetPinChannel). |
| SetPinRole | [PinRole][RoleIndexOrName] | This allows you to set a pin role, for example a Relay role, or Button, etc. Usually it's easier to do this through WWW panel, so you don't have to use this command.<br/><br/>See also [SetPinRole on forum](https://www.elektroda.com/rtvforum/find.php?q=SetPinRole). |
| SetStartValue | [Channel][Value] | Sets the startup value for a channel. Used for start values for relays. Use 1 for High, 0 for low and -1 for 'remember last state'.<br/><br/>See also [SetStartValue on forum](https://www.elektroda.com/rtvforum/find.php?q=SetStartValue). |
| SetupEnergyStats | [Enable1or0][SampleTime][SampleCount][JSonEnable] | Setup Energy Statistic Parameters: [enable 0 or 1] [sample_time[10..90]] [sample_count[10..180]] [JsonEnable 0 or 1]. JSONEnable is optional.<br/><br/>See also [SetupEnergyStats on forum](https://www.elektroda.com/rtvforum/find.php?q=SetupEnergyStats). |
@ -275,6 +275,7 @@ Do not add anything here, as it will overwritten with next rebuild.
| TS_Clear | | Clears the text scroller buffer.<br/><br/>See also [TS_Clear on forum](https://www.elektroda.com/rtvforum/find.php?q=TS_Clear). |
| TS_Print | [StartOfs] [MaxLenOr0] [StringText] [optionalBClampWithZeroesForClock] | Prints a text to the text scroller buffer.<br/><br/>See also [TS_Print on forum](https://www.elektroda.com/rtvforum/find.php?q=TS_Print). |
| tuyaMcu_defWiFiState | | Command sets the default WiFi state for TuyaMCU when device is not online. It may be required for some devices to work, because Tuya designs them to ignore touch buttons or beep when not paired. Please see [values table and description here](https://www.elektroda.com/rtvforum/viewtopic.php?p=20483899#20483899).<br/><br/>See also [tuyaMcu_defWiFiState on forum](https://www.elektroda.com/rtvforum/find.php?q=tuyaMcu_defWiFiState). |
| tuyaMcu_sendCmd | TuyaMCU_SendUserCmd | .<br/><br/>See also [tuyaMcu_sendCmd on forum](https://www.elektroda.com/rtvforum/find.php?q=tuyaMcu_sendCmd). |
| tuyaMcu_sendColor | [dpID] [red01] [green01] [blue01] [tuyaRGBformat] | This sends a TuyaMCU color string of given format for given RGB values, where each value is in [0,1] range as float.<br/><br/>See also [tuyaMcu_sendColor on forum](https://www.elektroda.com/rtvforum/find.php?q=tuyaMcu_sendColor). |
| tuyaMcu_sendCurTime | | Sends a current date by TuyaMCU to clock/callendar MCU. Time is taken from NTP driver, so NTP also should be already running.<br/><br/>See also [tuyaMcu_sendCurTime on forum](https://www.elektroda.com/rtvforum/find.php?q=tuyaMcu_sendCurTime). |
| tuyaMcu_sendHeartbeat | | Send heartbeat to TuyaMCU.<br/><br/>See also [tuyaMcu_sendHeartbeat on forum](https://www.elektroda.com/rtvforum/find.php?q=tuyaMcu_sendHeartbeat). |

View File

@ -40,3 +40,5 @@ Do not add anything here, as it will overwritten with next rebuild.
| $batteryLevel | Battery driver level |
| $uptime | Time since reboot in seconds |
| $failedBoots | Get number of failed boots (too quick reboots). Remember that you can change the uptime required to mark boot as 'okay' in general/flags menu |
| $rand01 | Random float between [0,1] |
| $rand | Random unsigned value |

View File

@ -21,6 +21,7 @@ Do not add anything here, as it will overwritten with next rebuild.
| ChargingLimit | Mechanism to perform an action based on a max. delta value and max time. Used to control Electric Vehicle chargers. See [discussion](https://github.com/openshwprojects/OpenBK7231T_App/issues/892).<br/>See also [ChargingLimit on forum](https://www.elektroda.com/rtvforum/find.php?q=ChargingLimit). |
| BL0937 | BL0937 is a power-metering chip which uses custom protocol to report data. It requires setting 3 pins in pin config: CF, CF1 and SEL.<br/>See also [BL0937 on forum](https://www.elektroda.com/rtvforum/find.php?q=BL0937). |
| CSE7766 | BL0942 is a power-metering chip which uses UART protocol for communication. It's usually connected to TX1/RX1 port of BK.<br/>See also [CSE7766 on forum](https://www.elektroda.com/rtvforum/find.php?q=CSE7766). |
| MAX6675 | BQQQK.<br/>See also [MAX6675 on forum](https://www.elektroda.com/rtvforum/find.php?q=MAX6675). |
| PT6523 | BQQQK.<br/>See also [PT6523 on forum](https://www.elektroda.com/rtvforum/find.php?q=PT6523). |
| TextScroller | BQQQK.<br/>See also [TextScroller on forum](https://www.elektroda.com/rtvforum/find.php?q=TextScroller). |
| SM16703P | SM16703P is an individually addressable LEDs controller like WS2812B. Currently SM16703P LEDs are supported through hardware SPI, LEDs data should be connected to P16 (MOSI), [here you can read](https://www.elektroda.com/rtvforum/topic4005865.html) how to break it out on CB2S.<br/>See also [SM16703P on forum](https://www.elektroda.com/rtvforum/find.php?q=SM16703P). |

View File

@ -1738,7 +1738,7 @@
},
{
"name": "SetPinChannel",
"args": "[PinIndex][ChannelIndex]",
"args": "[PinIndex][ChannelIndex][optionalChannel2Index]",
"descr": "This allows you to set a channel linked to pin from console. Usually it's easier to do this through WWW panel, so you don't have to use this command.",
"fn": "CMD_SetPinChannel",
"file": "cmnds/cmd_channels.c",
@ -2402,6 +2402,15 @@
"requires": "",
"examples": ""
},
{
"name": "tuyaMcu_sendCmd",
"args": "TuyaMCU_SendUserCmd",
"descr": "",
"fn": "NULL);",
"file": "driver/drv_tuyaMCU.c",
"requires": "",
"examples": ""
},
{
"name": "tuyaMcu_sendColor",
"args": "[dpID] [red01] [green01] [blue01] [tuyaRGBformat]",

View File

@ -202,5 +202,17 @@
"title": "$failedBoots",
"descr": "Get number of failed boots (too quick reboots). Remember that you can change the uptime required to mark boot as 'okay' in general/flags menu",
"requires": ""
},
{
"name": "$rand01",
"title": "$rand01",
"descr": "Random float between [0,1]",
"requires": ""
},
{
"name": "$rand",
"title": "$rand",
"descr": "Random unsigned value",
"requires": ""
}
]

View File

@ -83,6 +83,12 @@
"descr": "BL0942 is a power-metering chip which uses UART protocol for communication. It's usually connected to TX1/RX1 port of BK",
"requires": ""
},
{
"name": "MAX6675",
"title": "TODO",
"descr": "BQQQK",
"requires": ""
},
{
"name": "PT6523",
"title": "TODO",

View File

@ -784,8 +784,8 @@ void BL_Shared_Init(void)
//int HAL_SetEnergyMeterStatus(ENERGY_METERING_DATA *data);
//cmddetail:{"name":"EnergyCntReset","args":"",
//cmddetail:"descr":"Resets the total Energy Counter, the one that is usually kept after device reboots. After this commands, the counter will start again from 0.",
//cmddetail:{"name":"EnergyCntReset","args":"[OptionalNewValue]",
//cmddetail:"descr":"Resets the total Energy Counter, the one that is usually kept after device reboots. After this commands, the counter will start again from 0 (or from the value you specified).",
//cmddetail:"fn":"BL09XX_ResetEnergyCounter","file":"driver/drv_bl_shared.c","requires":"",
//cmddetail:"examples":""}
CMD_RegisterCommand("EnergyCntReset", BL09XX_ResetEnergyCounter, NULL);

View File

@ -2309,6 +2309,10 @@ void TuyaMCU_Init()
//cmddetail:"examples":""}
CMD_RegisterCommand("tuyaMcu_sendMCUConf", TuyaMCU_SendMCUConf, NULL);
//cmddetail:{"name":"tuyaMcu_sendCmd","args":"TuyaMCU_SendUserCmd",
//cmddetail:"descr":"",
//cmddetail:"fn":"NULL);","file":"driver/drv_tuyaMCU.c","requires":"",
//cmddetail:"examples":""}
CMD_RegisterCommand("tuyaMcu_sendCmd", TuyaMCU_SendUserCmd, NULL);
//cmddetail:{"name":"fakeTuyaPacket","args":"[HexString]",
//cmddetail:"descr":"This simulates packet being sent from TuyaMCU to our OBK device.",