ckarrie / ckw-ha-gs108e

HomeAssistant Netgear Switch Integration
16 stars 6 forks source link

Support for gs308ep #12

Open JohannCR opened 1 year ago

JohannCR commented 1 year ago

Is there any way to control (turn on/off) Poe power on switch gs308ep using this integration ?

ckarrie commented 1 year ago

Hi, unfortunately I don't own a gs308ep switch. Is this feature controllable via the netgear web UI?

JohannCR commented 1 year ago

Yes it is handled from the web UI. If you tell me what to look for maybe I can help you ? I suppose by looking at the chrome dev console we can find how it works and reproduce... I'm a python user so I can help a bit in the code too (but not used to working with classes, so I would at a minimum need help in defining the classes and then I could try to code stuff and test it out).

ckarrie commented 1 year ago

That would be very helpful. If this is similar to gs108e, the function to switch POE power should be in the web ui at portStatistics.cgi I basically needs

JohannCR commented 1 year ago

Here goes nothing ^^ Tell me if I missed anything

Url never changes it's IP/index.cgi

Here are the successive requests and the steps GET index.cgi GET dashboard.cgi

click on POE menu GET poe.cgi GET PoEPortConfig.cgi

expand selected port click on "EDIT" button GET getPoePortEdit.cgi

select port power value and click apply POST PoEPortConfig.cgi --> "SUCCESS" response Payload :

hash: 941460cdc0aad47a8de86ab4c37a8a5f ACTION: Apply portID: 3

note that the port ID go from 0 to 7

ADMIN_MODE: 0

it seems admin_mode 0 for powering off and 1 for powering on

PORT_PRIO: 0 POW_MOD: 3 POW_LIMT_TYP: 2 POW_LIMT: 30.0 DETEC_TYP: 2

GET PoEPortConfig.cgi --> response same as previous with only difference in port power value

Here is the html returned after PoEPortConfig request:

<div class="box_css">
<div id="module_div"class='module-div'>
<div class='module-title' style='padding-left: 0px;'>ml343</div>
<div class='module-content'>
<div class='module-content-text'>ml346</div>
</div>
<div class='module-content'>
<div class="module-content-header">ml334</div>
<div class='module-content-text'>ml335</div>
<div class='clearfix'>
<div class='checkbox'><input id='uninterruptedPoeStatus' type='checkbox' onclick="toggleSelect();submitUninterruptedPoE();" checked><label></label></div>
</div>
</div>
<div class='module-content'>
<div class="module-content-header">ml338</div>
<div class='module-content-text'>ml342</div>
</div>
<div class='port_list_content' style='margin-top:-10px;'>
<ul class="cable_test_port_list">
<li class="port_circle"><span class="port_circle_num">1</span></li>
<li class="port_circle"><span class="port_circle_num">2</span></li>
<li class="port_circle"><span class="port_circle_num">3</span></li>
<li class="port_circle"><span class="port_circle_num">4</span></li>
<li class="port_circle"><span class="port_circle_num">5</span></li>
<li class="port_circle"><span class="port_circle_num">6</span></li>
<li class="port_circle"><span class="port_circle_num">7</span></li>
<li class="port_circle"><span class="port_circle_num">8</span></li>
</ul>
</div>
<div class='submit_btn cabletestBtn' style='margin-top:0;margin-bottom:0;'>
<span class='text-primary'>
<button name='submitPwrCyclePorts' data-react-toolbox='button' onclick="submitPwrCyclePorts();" class='toolbox_lib_button button_theme_flat button_theme_primary button_theme_mini button button_mini' disabled=''>APPLY</button>
</span>
<span class='text-muted'>
<button name='cancelPwrCyclePorts' data-react-toolbox='button' onclick="cancelCableTest();disableButtons();" class='toolbox_lib_button button_theme_flat button_theme_default button_theme_mini button button_mini' disabled=''>CANCEL</button>
</span>
</div>
</div>
<div style="margin-top:-10px;">
<div class="poe-port-box" id="poe_port_list"  style="position:relative">
<div class="widget_header">
<div class="widget_header_title">
<ul class="poe_port_list">
<li class="active" id="poeSettingSelect" onclick="changePoeEditOption(this)">
<p style='font-size:0.875rem;'>ml595</p></li>
<li id="poeStatusSelect" onclick="changePoeEditOption(this)">
<p style='font-size:0.875rem;'>ml583</p></li>
<div class="indicator"></div>
</ul>
</div>
</div>
<div class="box_flex" id="poe_port_list_show">
<div style='color:#817d88;height:3.125rem;border-bottom: 1px solid rgba(46, 43, 51, .5);'>
<ul class="poe_port_list" style="padding-left:1.875rem;">
<li><p style="text-align:left">ml578</p></li>
<li><p style="text-align:left">ml549</p></li>
<li><p style="text-align:left">ml553</p></li>
</ul>
</div>
<div id="poe_port_details" class="box_flex">
<ul class="list_css">
<li class="poe_port_list_item poePortSettingListItem index_li">
<div name='isShowPot1' class="poe_li_header_content">
<i class="mid_title_icon icon_color_gray icon_sm accordion_icon accordion_plus pull-right" style="padding-right:12%;">
<span class="icon-expand"></span>
</i>
<span class="pull-right poe-power-mode">
<span>802.3at</span>
<input type="hidden" class="pwrMode" id="hidPwrMode" value="3"></span>
<span class="pull-right poe-portPwr-width">
<span class="portPwr">Disable</span>
<input type="hidden" class="hidPortPwr" id="hidPortPwr" value="0">
</span>
<span class="poe_index_li_title poe-port-index">
<input type="hidden" class="port" value="1">
<span>1</span></span></div>
<input type="hidden" class="portName" value="">
<div class="poe_port_info">
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml551</span>
</div>
<div>
<span class="portPrioShow">Low</span>
<input type="hidden" class="portPrio" id="hidPortPrio" value="0">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml554</span>
</div>
<div>
<span class="pwrLimTypeShow">User</span>
<input type="hidden" class="pwrLimitType" id="hidLimitType" value="2">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml557</span>
</div>
<div>
<span class="pwrLimitShow">30.0</span>
<input type="hidden" class="pwrLimit" value="30.0">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml559</span>
</div>
<div>
<span class="detecTypeShow">IEEE 802</span>
<input type="hidden" class="detecType" id="hidDetecType" value="2">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div onclick="edit_poe_port_info();" class="poe_edit_btn">
<button name='editPot1' data-react-toolbox="button" class="toolbox_lib_button button_theme_flat button_theme_primary button_theme_mini button button_mini">
EDIT
</button>
</div>
</div>
</div>
</li>
<li class="poe_port_list_item poePortSettingListItem index_li">
<div name='isShowPot2' class="poe_li_header_content">
<i class="mid_title_icon icon_color_gray icon_sm accordion_icon accordion_plus pull-right" style="padding-right:12%;">
<span class="icon-expand"></span>
</i>
<span class="pull-right poe-power-mode">
<span>802.3at</span>
<input type="hidden" class="pwrMode" id="hidPwrMode" value="3"></span>
<span class="pull-right poe-portPwr-width">
<span class="portPwr">Disable</span>
<input type="hidden" class="hidPortPwr" id="hidPortPwr" value="0">
</span>
<span class="poe_index_li_title poe-port-index">
<input type="hidden" class="port" value="2">
<span>2</span></span></div>
<input type="hidden" class="portName" value="">
<div class="poe_port_info">
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml551</span>
</div>
<div>
<span class="portPrioShow">Low</span>
<input type="hidden" class="portPrio" id="hidPortPrio" value="0">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml554</span>
</div>
<div>
<span class="pwrLimTypeShow">User</span>
<input type="hidden" class="pwrLimitType" id="hidLimitType" value="2">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml557</span>
</div>
<div>
<span class="pwrLimitShow">30.0</span>
<input type="hidden" class="pwrLimit" value="30.0">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml559</span>
</div>
<div>
<span class="detecTypeShow">IEEE 802</span>
<input type="hidden" class="detecType" id="hidDetecType" value="2">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div onclick="edit_poe_port_info();" class="poe_edit_btn">
<button name='editPot2' data-react-toolbox="button" class="toolbox_lib_button button_theme_flat button_theme_primary button_theme_mini button button_mini">
EDIT
</button>
</div>
</div>
</div>
</li>
<li class="poe_port_list_item poePortSettingListItem index_li">
<div name='isShowPot3' class="poe_li_header_content">
<i class="mid_title_icon icon_color_gray icon_sm accordion_icon accordion_plus pull-right" style="padding-right:12%;">
<span class="icon-expand"></span>
</i>
<span class="pull-right poe-power-mode">
<span>802.3at</span>
<input type="hidden" class="pwrMode" id="hidPwrMode" value="3"></span>
<span class="pull-right poe-portPwr-width">
<span class="portPwr">Disable</span>
<input type="hidden" class="hidPortPwr" id="hidPortPwr" value="0">
</span>
<span class="poe_index_li_title poe-port-index">
<input type="hidden" class="port" value="3">
<span>3</span></span></div>
<input type="hidden" class="portName" value="">
<div class="poe_port_info">
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml551</span>
</div>
<div>
<span class="portPrioShow">Low</span>
<input type="hidden" class="portPrio" id="hidPortPrio" value="0">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml554</span>
</div>
<div>
<span class="pwrLimTypeShow">User</span>
<input type="hidden" class="pwrLimitType" id="hidLimitType" value="2">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml557</span>
</div>
<div>
<span class="pwrLimitShow">30.0</span>
<input type="hidden" class="pwrLimit" value="30.0">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml559</span>
</div>
<div>
<span class="detecTypeShow">IEEE 802</span>
<input type="hidden" class="detecType" id="hidDetecType" value="2">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div onclick="edit_poe_port_info();" class="poe_edit_btn">
<button name='editPot3' data-react-toolbox="button" class="toolbox_lib_button button_theme_flat button_theme_primary button_theme_mini button button_mini">
EDIT
</button>
</div>
</div>
</div>
</li>
<li class="poe_port_list_item poePortSettingListItem index_li">
<div name='isShowPot4' class="poe_li_header_content">
<i class="mid_title_icon icon_color_gray icon_sm accordion_icon accordion_plus pull-right" style="padding-right:12%;">
<span class="icon-expand"></span>
</i>
<span class="pull-right poe-power-mode">
<span>802.3at</span>
<input type="hidden" class="pwrMode" id="hidPwrMode" value="3"></span>
<span class="pull-right poe-portPwr-width">
<span class="portPwr">Disable</span>
<input type="hidden" class="hidPortPwr" id="hidPortPwr" value="0">
</span>
<span class="poe_index_li_title poe-port-index">
<input type="hidden" class="port" value="4">
<span>4</span></span></div>
<input type="hidden" class="portName" value="">
<div class="poe_port_info">
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml551</span>
</div>
<div>
<span class="portPrioShow">Low</span>
<input type="hidden" class="portPrio" id="hidPortPrio" value="0">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml554</span>
</div>
<div>
<span class="pwrLimTypeShow">User</span>
<input type="hidden" class="pwrLimitType" id="hidLimitType" value="2">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml557</span>
</div>
<div>
<span class="pwrLimitShow">30.0</span>
<input type="hidden" class="pwrLimit" value="30.0">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml559</span>
</div>
<div>
<span class="detecTypeShow">IEEE 802</span>
<input type="hidden" class="detecType" id="hidDetecType" value="2">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div onclick="edit_poe_port_info();" class="poe_edit_btn">
<button name='editPot4' data-react-toolbox="button" class="toolbox_lib_button button_theme_flat button_theme_primary button_theme_mini button button_mini">
EDIT
</button>
</div>
</div>
</div>
</li>
<li class="poe_port_list_item poePortSettingListItem index_li">
<div name='isShowPot5' class="poe_li_header_content">
<i class="mid_title_icon icon_color_gray icon_sm accordion_icon accordion_plus pull-right" style="padding-right:12%;">
<span class="icon-expand"></span>
</i>
<span class="pull-right poe-power-mode">
<span>802.3at</span>
<input type="hidden" class="pwrMode" id="hidPwrMode" value="3"></span>
<span class="pull-right poe-portPwr-width">
<span class="portPwr">Disable</span>
<input type="hidden" class="hidPortPwr" id="hidPortPwr" value="0">
</span>
<span class="poe_index_li_title poe-port-index">
<input type="hidden" class="port" value="5">
<span>5</span></span></div>
<input type="hidden" class="portName" value="">
<div class="poe_port_info">
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml551</span>
</div>
<div>
<span class="portPrioShow">Low</span>
<input type="hidden" class="portPrio" id="hidPortPrio" value="0">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml554</span>
</div>
<div>
<span class="pwrLimTypeShow">User</span>
<input type="hidden" class="pwrLimitType" id="hidLimitType" value="2">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml557</span>
</div>
<div>
<span class="pwrLimitShow">30.0</span>
<input type="hidden" class="pwrLimit" value="30.0">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml559</span>
</div>
<div>
<span class="detecTypeShow">IEEE 802</span>
<input type="hidden" class="detecType" id="hidDetecType" value="2">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div onclick="edit_poe_port_info();" class="poe_edit_btn">
<button name='editPot5' data-react-toolbox="button" class="toolbox_lib_button button_theme_flat button_theme_primary button_theme_mini button button_mini">
EDIT
</button>
</div>
</div>
</div>
</li>
<li class="poe_port_list_item poePortSettingListItem index_li">
<div name='isShowPot6' class="poe_li_header_content">
<i class="mid_title_icon icon_color_gray icon_sm accordion_icon accordion_plus pull-right" style="padding-right:12%;">
<span class="icon-expand"></span>
</i>
<span class="pull-right poe-power-mode">
<span>802.3at</span>
<input type="hidden" class="pwrMode" id="hidPwrMode" value="3"></span>
<span class="pull-right poe-portPwr-width">
<span class="portPwr">Disable</span>
<input type="hidden" class="hidPortPwr" id="hidPortPwr" value="0">
</span>
<span class="poe_index_li_title poe-port-index">
<input type="hidden" class="port" value="6">
<span>6</span></span></div>
<input type="hidden" class="portName" value="">
<div class="poe_port_info">
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml551</span>
</div>
<div>
<span class="portPrioShow">Low</span>
<input type="hidden" class="portPrio" id="hidPortPrio" value="0">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml554</span>
</div>
<div>
<span class="pwrLimTypeShow">User</span>
<input type="hidden" class="pwrLimitType" id="hidLimitType" value="2">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml557</span>
</div>
<div>
<span class="pwrLimitShow">30.0</span>
<input type="hidden" class="pwrLimit" value="30.0">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml559</span>
</div>
<div>
<span class="detecTypeShow">IEEE 802</span>
<input type="hidden" class="detecType" id="hidDetecType" value="2">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div onclick="edit_poe_port_info();" class="poe_edit_btn">
<button name='editPot6' data-react-toolbox="button" class="toolbox_lib_button button_theme_flat button_theme_primary button_theme_mini button button_mini">
EDIT
</button>
</div>
</div>
</div>
</li>
<li class="poe_port_list_item poePortSettingListItem index_li">
<div name='isShowPot7' class="poe_li_header_content">
<i class="mid_title_icon icon_color_gray icon_sm accordion_icon accordion_plus pull-right" style="padding-right:12%;">
<span class="icon-expand"></span>
</i>
<span class="pull-right poe-power-mode">
<span>802.3at</span>
<input type="hidden" class="pwrMode" id="hidPwrMode" value="3"></span>
<span class="pull-right poe-portPwr-width">
<span class="portPwr">Disable</span>
<input type="hidden" class="hidPortPwr" id="hidPortPwr" value="0">
</span>
<span class="poe_index_li_title poe-port-index">
<input type="hidden" class="port" value="7">
<span>7</span></span></div>
<input type="hidden" class="portName" value="">
<div class="poe_port_info">
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml551</span>
</div>
<div>
<span class="portPrioShow">Low</span>
<input type="hidden" class="portPrio" id="hidPortPrio" value="0">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml554</span>
</div>
<div>
<span class="pwrLimTypeShow">User</span>
<input type="hidden" class="pwrLimitType" id="hidLimitType" value="2">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml557</span>
</div>
<div>
<span class="pwrLimitShow">30.0</span>
<input type="hidden" class="pwrLimit" value="30.0">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml559</span>
</div>
<div>
<span class="detecTypeShow">IEEE 802</span>
<input type="hidden" class="detecType" id="hidDetecType" value="2">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div onclick="edit_poe_port_info();" class="poe_edit_btn">
<button name='editPot7' data-react-toolbox="button" class="toolbox_lib_button button_theme_flat button_theme_primary button_theme_mini button button_mini">
EDIT
</button>
</div>
</div>
</div>
</li>
<li class="poe_port_list_item poePortSettingListItem index_li">
<div name='isShowPot8' class="poe_li_header_content">
<i class="mid_title_icon icon_color_gray icon_sm accordion_icon accordion_plus pull-right" style="padding-right:12%;">
<span class="icon-expand"></span>
</i>
<span class="pull-right poe-power-mode">
<span>802.3at</span>
<input type="hidden" class="pwrMode" id="hidPwrMode" value="3"></span>
<span class="pull-right poe-portPwr-width">
<span class="portPwr">Disable</span>
<input type="hidden" class="hidPortPwr" id="hidPortPwr" value="0">
</span>
<span class="poe_index_li_title poe-port-index">
<input type="hidden" class="port" value="8">
<span>8</span></span></div>
<input type="hidden" class="portName" value="">
<div class="poe_port_info">
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml551</span>
</div>
<div>
<span class="portPrioShow">Low</span>
<input type="hidden" class="portPrio" id="hidPortPrio" value="0">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml554</span>
</div>
<div>
<span class="pwrLimTypeShow">User</span>
<input type="hidden" class="pwrLimitType" id="hidLimitType" value="2">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml557</span>
</div>
<div>
<span class="pwrLimitShow">30.0</span>
<input type="hidden" class="pwrLimit" value="30.0">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div class="hid_info_title">
<span class='hid-txt wid-full'>ml559</span>
</div>
<div>
<span class="detecTypeShow">IEEE 802</span>
<input type="hidden" class="detecType" id="hidDetecType" value="2">
</div>
</div>
<div class="hid_info_cell col-xs-12 col-sm-6">
<div onclick="edit_poe_port_info();" class="poe_edit_btn">
<button name='editPot8' data-react-toolbox="button" class="toolbox_lib_button button_theme_flat button_theme_primary button_theme_mini button button_mini">
EDIT
</button>
</div>
</div>
</div>
</li>
</ul></div></div>
<div class="poe_box_css volumes-scss widget_height has-bottom-opacity-effect " id="poe_port_edit">
</div>
<div class="box_flex" id="poe_port_status_show"></div>
</div>
</div>
</div>
<input type=hidden name='hash' id='hash' value="941460cdc0aad47a8de86ab4c37a8a5f">
<script type="text/javascript">
function toggleSelectPort()
{
var $port = $(".cable_test_port_list li");
$port.click(function(){
$(this).toggleClass("port_circle_selected");
if($port.hasClass("port_circle_selected")==false){
 disableButtons();
}
else{
 enableButtons();
}
});
}
$(document).ready(function(){
    toggleSelectPort();
    collapseOrExpandPoeBlock($(".poePortSettingListItem .poe_li_header_content"), $(".poe_port_info"), $(".poePortSettingListItem .poe_li_header_content .mid_title_icon span"));
    edit_poe_port_info();
    back_poe_port_info();
    transPage($('#transContent')[0]);
});
</script>
ckarrie commented 1 year ago

Thank you!

ckarrie commented 1 year ago

Hi @JohannCR I ordered a GS308EP for a customer last week and finally found some time to take a look into it. Bad News first: Sadly the Netgear Firmware on the GS308EP is very different to the GS108E - so its not supported at the moment by this integration. Now the good news: I ordered a second GS308EP for myself and plan to implemement this switch into this integration - but I will take some time.

JohannCR commented 1 year ago

That's great thanks !

estozehn commented 9 months ago

Hi @ckarrie I stumbled over your integration, as I wanted to read out some data from a netgear GS308E (without P), just to read this thread. Obviously I could read all the info I already knew, like name and such, but no traffic information. Are you still active on this great project?

ckarrie commented 9 months ago

Hi @estozehn could you please create a new issue for lacking traffic informations for your GS308E (including Firmware version). Thnak you :-)

ckarrie commented 9 months ago

Back to the GS308EP: sorry I didn't find the time to add support for the GS308EP. I took a quick look at into it after I received the device but it seems to use a complete different firmware. But I will keep that in mind.

ckarrie commented 9 months ago

GS308Ex seems to be just an updated version of the GS108Ex. Netgear using a complete new firmware for the GS3xx Series. Integration is planned as soon as I get a device.

Ref to #13

AlessandroTischer commented 1 month ago

GS308Ex seems to be just an updated version of the GS108Ex. Netgear using a complete new firmware for the GS3xx Series. Integration is planned as soon as I get a device.

Ref to #13

Hi! Did you manage to make the poe functionality work in home assistant? I'm planning to buy a G316EP, and having the switch controlled in HA would be a great life improvement!

ckarrie commented 1 month ago

GS308Ex seems to be just an updated version of the GS108Ex. Netgear using a complete new firmware for the GS3xx Series. Integration is planned as soon as I get a device.

Ref to #13

Hi! Did you manage to make the poe functionality work in home assistant? I'm planning to buy a G316EP, and having the switch controlled in HA would be a great life improvement!

Just started working in it. Stay tuned.

ckarrie commented 3 weeks ago

@AlessandroTischer can you check out v0.6.0 if it works for your GS316EP?

AlessandroTischer commented 3 weeks ago

@AlessandroTischer can you check out v0.6.0 if it works for your GS316EP?

I get "Connection or login error: please check your configuration". Unfortunately nothing is in the log.

BTW, I bought a GS316EPP in the end, but I think the only difference is in the power supply.

EDIT: I gave a quick look at the commits for the GS3xx branch and noticed the model numbers are hardcoded, so maybe the problem is actually the second P in my model number?

ckarrie commented 3 weeks ago

Yeah, error messages are very unuseful at the moment. I already added the GS316EPP but did not included them because I had nobody to test. Now I have you and I add it to the autodetection of the Switch Model soon.

https://github.com/ckarrie/ckw-ha-gs108e/blob/main/custom_components/ckw_hass_gs108e/gs108e/models.py#L107

ckarrie commented 3 weeks ago

Please give https://github.com/ckarrie/ckw-ha-gs108e/releases/tag/v0.6.1 a try

AlessandroTischer commented 3 weeks ago

Please give https://github.com/ckarrie/ckw-ha-gs108e/releases/tag/v0.6.1 a try

Unfortunately I have the same error as before...

@ckarrie let me know if there is anything I can do to help you debug this behaviour

JohannCR commented 3 weeks ago

Hi there, Awesome that you're looking into it, thanks !

Just tried it on 0.6.1 it gives me this error in the log. Hope that helps

2024-06-29 18:48:00.793 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/urllib3/connection.py", line 174, in _new_conn conn = connection.create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/urllib3/util/connection.py", line 72, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/socket.py", line 963, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ socket.gaierror: [Errno -5] Name has no usable address During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 416, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/local/lib/python3.12/site-packages/urllib3/connection.py", line 244, in request super(HTTPConnection, self).request(method, url, body=body, headers=headers) File "/usr/local/lib/python3.12/http/client.py", line 1331, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/local/lib/python3.12/http/client.py", line 1377, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/local/lib/python3.12/http/client.py", line 1326, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/local/lib/python3.12/http/client.py", line 1085, in _send_output self.send(msg) File "/usr/local/lib/python3.12/http/client.py", line 1029, in send self.connect() File "/usr/local/lib/python3.12/site-packages/urllib3/connection.py", line 205, in connect conn = self._new_conn() ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fe3639dd4f0>: Failed to establish a new connection: [Errno -5] Name has no usable address During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/requests/adapters.py", line 667, in send resp = conn.urlopen( ^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 801, in urlopen retries = retries.increment( ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/urllib3/util/retry.py", line 594, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='http', port=80): Max retries exceeded with url: /192.168.68.240//login.cgi (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fe3639dd4f0>: Failed to establish a new connection: [Errno -5] Name has no usable address')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware response = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, **request.match_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin return await func(self, request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post return await super().post(request, flow_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 70, in wrapper return await method(view, request, data, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post result = await self._flow_mgr.async_configure(flow_id, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 368, in async_configure result = await self._async_configure(flow_id, user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 414, in _async_configure result = await self._async_handle_step( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 517, in _async_handle_step result: _FlowResultT = await getattr(flow, method)(user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/ckw_hass_gs108e/config_flow.py", line 110, in async_step_user api = await self.hass.async_add_executor_job(get_api, host, password) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/ckw_hass_gs108e/netgear_switch.py", line 29, in get_api api.autodetect_model() File "/config/custom_components/ckw_hass_gs108e/gs108e/__init__.py", line 101, in autodetect_model self.check_login_url() File "/config/custom_components/ckw_hass_gs108e/gs108e/__init__.py", line 162, in check_login_url resp = requests.get( ^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/requests/api.py", line 73, in get return request("get", url, params=params, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/requests/api.py", line 59, in request return session.request(method=method, url=url, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/requests/adapters.py", line 700, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='http', port=80): Max retries exceeded with url: /192.168.68.240//login.cgi (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fe3639dd4f0>: Failed to establish a new connection: [Errno -5] Name has no usable address'))

AlessandroTischer commented 2 weeks ago

Please give https://github.com/ckarrie/ckw-ha-gs108e/releases/tag/v0.6.1 a try

Sorry to bother you. Is there any chance I can help debugging? So far I cannot log in to the switch with the 0.6.1 integration

ckarrie commented 2 weeks ago

Hi there, Awesome that you're looking into it, thanks !

Just tried it on 0.6.1 it gives me this error in the log. Hope that helps

requests.exceptions.ConnectionError: HTTPConnectionPool(host='http', port=80): Max retries exceeded with url: /192.168.68.240//login.cgi (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fe3639dd4f0>: Failed to establish a new connection: [Errno -5] Name has no usable address'))

URL looks strange: exceeded with url: /192.168.68.240//login.cgi did you add a backslash at the end of the url? Try only the IP.

ckarrie commented 2 weeks ago

Please give https://github.com/ckarrie/ckw-ha-gs108e/releases/tag/v0.6.1 a try

Sorry to bother you. Is there any chance I can help debugging? So far I cannot log in to the switch with the 0.6.1 integration

Don't know where the problem could be, I created a separate Issue #20 for your case

JohannCR commented 1 week ago

URL looks strange: exceeded with url: /192.168.68.240//login.cgi did you add a backslash at the end of the url? Try only the IP.

(sorry for the late response) Damn you're right, I didn't catch that and don't know why the hell I put that backslash 🤣 So adding the integration works without the backslash (duh), but then I have the following error

Unexpected error fetching GS308EP 192.168.68.240 Switch infos data Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 268, in _async_update_data return await self.update_method() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/ckw_hass_gs108e/__init__.py", line 57, in async_update_switch_infos return await gs_switch.async_get_switch_infos() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/ckw_hass_gs108e/netgear_switch.py", line 77, in async_get_switch_infos return await self.hass.async_add_executor_job(self.api.get_switch_infos) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/ckw_hass_gs108e/gs108e/__init__.py", line 490, in get_switch_infos page = self.fetch_switch_infos() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/ckw_hass_gs108e/gs108e/__init__.py", line 281, in fetch_switch_infos url_tmpl = self.switch_model.DASHBOARD_CGI_URL_TMPL ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'GS308EP' object has no attribute 'DASHBOARD_CGI_URL_TMPL'

JohannCR commented 1 week ago

I added DASHBOARD_CGI_URL_TMPL = "http://{ip}/dashboard.cgi" for class GS308EP(GS3xxSeries) in file custom_components/ckw_hass_gs108e/gs108e/models.py and now it works ! Going to test the entities and report back

JohannCR commented 1 week ago

It works, I can control the POE switches

Thanks a lot, this is awesome !